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?


I wrote a small cross-platform tool that allows you to download attachments from GMail or Inbox, and optionally remove them from the original emails:


  • 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 '18 at 23:56

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. – ronaldwidha Aug 14 '18 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, privacy policy and cookie policy

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