How to remove attachments in Gmail without deleting the mail
I've been using Gmail as my primary mail client for all my mail addresses for a few years now. All mails are automatically forwarded to my Gmail account and every address has a proper alias configured, which is automatically the default when hitting reply. Combined with the incredibly fast and powerful search engine and custom filters, I can hardly imagine something better. Once set up properly, it does all the work for you. However, Gmail is not perfect and I am missing some features.
After a few years of collecting and labelling all mails my storage was getting pretty full. The solution: Delete all attachments of old mails from work but keep the actual mail.
There are a few ways of doing this. Most of them require manual work, like downloading all mails with something like Thunderbird or Outlook and then manually removing the attachments before reuploading the mail without them. Some other methods use addons or built-in functions to do this, but it always requires a lot of manual work and a few extra steps. When you're dealing with thousands of mails with specific labels (which aren't properly supported in the clients I mentioned anyway), then this quickly gets out of hand. There also was one shady app called "Dittach" once, but it has since been wiped from planet earth.
However, there is one piece of free software, which is still being actively developed and does all that work for you while also allowing you to use Gmails powerful search queries.
Note: As of December 23rd of 2020 if you want to get Unattach for free you have to compile the source code yourself. If you don't want to do that, you can pay $4.99 to get a precompiled version, which you can simply install and use. You can also try this portable version of an outdated build from when the software was still free.
Unattach does not get enough credit. Rok Strniša, the developer behind this awesome little app, offers versions for Windows, macOS and Ubuntu, so you're probably good to go right there. Download, launch and authorize the app to get started.
To actually remove all your unneccessary attachments, you have two modes available: Basic and Advanced.
To get the most out of it I recommend going with the Advanced tab. This allows you to use all the search features Gmail offers.
has:attachment size:1m label:work older_than:6m
This gives you all mails older than 6 months with the label "Work" which are bigger than 1 megabyte and have attachments. Perfect! This was just what I needed.
Hit search, wait for it to finish and select which mails you want processed before hitting "Delete attachments" to free up some precious space.One added bonus: It adds a handy list of files and the date of removal to each mail. Nice!
Depending on how many mails your query returns you may have to repeat these steps, as Unattach only lets you process 500 mails at a time.
As you can see, a simple tool like Unattach can make quick work of an otherwise laborious and repetetive task and once it's done, you should have enough space to last you another few years.