I signed up for a Gmail account in 2007. Fourteen years later, I had amassed more than 100,000 emails and started receiving notifications from Google that I was above 85% on my storage. Obviously, most of those emails aren’t important to save, so I wanted to start by cleaning up those unimportant emails. Here are the queries that I used to identify the old emails to delete.

High Volume Emails

Those 100k emails were mostly from various mailing lists. To get rid of the high volume emails, this query identifies emails that are unread, old, in one of the inbox categories, not starred, and not important. This resulted in the deletion of some 60k emails. I had to run the query multiple times to delete all the emails.

is:unread AND older_than:1y AND (label:Forums OR label:Promotions OR label:Social OR label:Updates) -in:starred AND -in:priority

Large emails

I also had 100 emails with attachments larger than 10MB. Whereas I could blindly delete all the high volume emails, these I had to manually review and didn’t save as much space.

has:attachment larger:10M


Deleting the high volume emails saved a lot of space. I wish there was a way to regularly schedule that type of cleanup. 40k emails is still a lot, but I couldn’t come up with any other ideas to save space without getting rid of anything important.