I'd like to free up some storage space and delete attachments from most/all the messages in my Gmail. I've long since downloaded and used any attachments I need or care to keep. How can I delete attachments from Gmail, but keep the messages?

I've read this and this, but the first is a little old, and the second is too manual. (I have thousands of messages archived. Forwarding each one to myself would take forever.) I'm looking for a less manual/tedious solution.

How can I purge old attachments that do nothing now but take up space, and still keep the original, valuable messages?


4 Answers 4


I wrote an app called Unattach, which allows you to easily download Gmail attachments in bulk, and optionally remove them.

  • Hi Rok, when I run the jar, nothing happens. No window appears, nothing in the console. OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1~deb9u1-b13)
    – Jayen
    Nov 16, 2018 at 23:56
  • @Jayen The new version of Slimbox (v1.7.0) should be easier to use, since it comes prepackaged with all dependencies. I hope that resolves the issue you describe. May 9, 2020 at 12:19
  • @Jayen There should also be "Downloads". May be best to move this discussion offline. You can find my contact through the website above. May 9, 2020 at 20:01
  • Thanks Rok, my screen isn't tall enough for your application, so if I maximize the window, I can't scroll to the bottom. I need to unmaximize and move the window up to see the bottom section.
    – Jayen
    May 10, 2020 at 6:23
  • @Jayen I created a ticket for this issue: github.com/rokstrnisa/slimbox/issues/4 May 10, 2020 at 14:19

I think that you just have to delete the message. If you need the message then you could copy the text and keep it in Google Drive. Or send yourself a email with the text, and delete the original.


IMAPSize is the perfect tool to do that.

And how you can use it : http://www.labnol.org/software/delete-large-email-attachments-in-gmail/9564/

  • This is 2018, seems IMAPSize always stuck on 15% then crash. Slimbox works better for me. Aug 14, 2018 at 0:53

Try this Google Docs script, it worked for me. It does not require installing anything.

How does it work (description from the blogpost):

  1. You specify the size of the emails to be found in Megabyte.
  2. All emails with that or above that size are retrieved and shown.
  3. On select of delete all, those emails are processed.
  4. All attachments in the message are backed up in your Google Drive under the folder name Gmail_Attachments. So they will remain safe there you can refer them whenever needed.
  5. Copy of email body is created and it is sent as a new email to your account from your own ID. So is the time stamp and sender details of original message lost? No. They are fetched and appended to the new email copy. Details like date, from, to, cc are retained.
  6. Finally original email along with the attachments are trashed.

P.S. If you have already run out of space, #4 will not work (Drive will not allow uploading new files), but the attachments still will be accessible from your Gmail trash, so you can safely download them manually and only then empty the trash.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.