Using Filters And Labels To Free Up Gmail Space

July 22nd, 2009 by Martin

Yesterday my catch-all Gmail account reached the 92 % watermark, and I found it alarming. I had been looking time and again for effective ways to clean up, but none seemed viable as I had over 60,000 emails on file.

Judging from what I learned online, there seems to be two ways of doing this. Either with a desktop client that syncs both ways (best described here) or by using advanced search operators. I tried using Thunderbird, but with no luck; maybe because I had too many emails to work with. I had earlier fiddled around with the advanced search, but quickly got bored since Gmail will only show you 20 search results at a time. I was pretty discouraged, and thought: The reason Gmail doesn’t want you to clean up effectively is because they want you to make some money on the extra storage.

But Gmail now actually gives you pretty excellent tools to free up space. Here’s the way I did it:

Deleting All The Content Of A Gmail Label

Create a filter that finds stuff you want to delete and assign a label to it. I already had one called ‘Newsletters’ that had over 11,000 emails in it (I’m using Gmail basically like a feed reader and subscribe to many hundreds of newsletters from sites that do not use RSS). Open your label and select ‘All’. Now, while this only selects the visible emails, notice that an option appears: ‘Select all 11,000 conversations in “Newsletters”. Doing so enables you to completely wipe the entire content of a label. You can of course deselect the most recent stuff, if you want to keep that, but old newsletters is not really valuable information to me so I let them all go.

Delete all the content of a Gmail label

When you do a simple search Gmail now also gives you the option to select all the results of that search, and thus delete them if you like. Yet I’m not really comfortable doing to because you often don’t know how many emails you will be deleting. A search will show you “1-20 of thousands” and that’s not accurate enough for me.

A Little Gmail Secret?

The option to select all search results or everything with a specific label must be new. I haven’t found any info about it on the Gmail blog and I spent a lot of time searching for it, but with no luck. I even found this recent Python script for purging a label (dated May), so it must be a fairly new option since someone had gone through the trouble of developing a script. (Update: See comment here. Anyone else knows when mass-selecting labels and searches became available?).

Search vs. Labels

Next, I created a filter simply searching for conversations with attachments. Gmail’s definition of ‘attachment’ also includes email with just a piece of graphic in it, so you’ll probably get more results than you hoped for. And while creating a label you cannot use ‘filename:pdf’ or ‘filename:ppt’ etc. and that’s an annoying drawback. It should be easy for Gmail to add this option though. Another drawback is that it reportedly has no way of sorting by attachment size, but please tell me if you know of any that doesn’t include downloading everything via POP3 or IMAP.

Another cool thing about going down the filter/label path for attachments, instead of just searching, is that Gmail allows you to go to the ‘Oldest’ conversations in a label and start deleting old stuff first as this is normally the least relevant. Try searching for ‘has:attachment’ and you’ll notice that you can only select ‘Older >’ and it shows you just 20 emails at a time. When using labels you can view 100 messages at a time, which is the maximum amount of conversations Gmail lets you show. Labels and filters are the way to go.

Don’t Delete Anything, But Stay Organized

Here’s how I normally use Gmail: I get a lot of digests, notifications, newsgroup discussions etc. and it’s so easy to organize with filters and labels. I never delete anything. I just concentrate on the unread conversations. Once it’s read I never look at it again, or, if I have to do something about it, I add a star to it (make sure you install the Superstars from Labs, it gives you more start to play with; I use different starts to signify importance or type).

When you eventually need more space, it’s fairly easy to prune stuff marked with a label, now that Gmail offers this. I’ve never had any use for the archive since Gmail search is so effective, and I’ve given up on having a neat and tidy Inbox a long time ago anyway.

Afraid to lose precious data?

Last time Gmail had performance problems I was basically paralyzed, as vital parts of my life runs through it. I don’t use a desktop email client as it’s against the whole concept of cloud storage, and it makes your life difficult if you use several computers like I do. I do use Gears though, so I can now keep going next time Gmail temporarily is dodgy.

But what about mass-deleting stuff like I suggest above? What if you screw up and delete precious photos or your unpublished novel? (I for one have stuff like that in my Gmail!) Well, first of all Gmail will prompt you when you delete hundreds or thousands of conversations like this. When you click Delete you can undo it right after. And emails are not deleted instantly, they are just moved to the Trash folder, from where you will have to permanently remove them for real to free up space.

You just need to be very specific when setting up your filters, and check that it only finds exactly what you’re looking for.

Create A Secondary Gmail Archive

If that’s not enough security for you, how about this approach:

  1. Create a secondary Gmail account for archiving purposes.
  2. Make sure to forward stuff before you delete it, either manually or by using a filter (Gmail filters allows you to do both in one go, and you can simply select ‘Apply to all’).
  3. To stay organized, use labeling like this: Forward your email to ‘username+label@gmail.com’, where ‘username’ is your new Gmail username and ‘label’ is a keyword to describe what kind of content you are forwarding.
  4. Set up a new filter on your archive account that finds anything sent directly to ‘username+label@gmail.com’ and add a label to it.
  5. All your forwarded stuff is now neatly organized with labels. You can even use the archive to automatically forward precious stuff that you’re afraid to delete by mistake.

I’m now down to 80 %, 20,000+ emails lighter, and that only took me 2 minutes when I discovered how. That should tie me over at least a couple of months.

Of course, if you don’t want to bother with any of this, simply set up a new account and forward all email to this. Set up your new account to use the old Gmail address, and your friends will never know you switched.

Now, I don’t really think the extra storage is that pricey and it of course gives you the comfort of having everything in the same place. It’s just more fun doing it like I describe above. And free. Gmail is by far the most valuable application for me, next after search of course. Sometimes you need to pinch your arm, and ask how can this be free and yet so valuable …

Post to Twitter

Related posts:

  1. 5 Penetrating Tips: Learning Online Marketing From Spammers ...

Category: DIY, Tech
Stumble It
Add to Del.icio.us

Did you like this post?

Sharing is a great way to say thanks!


RSS

Subscribe to FerroGate

3 Responses

  1. tante

    Hossa, I am the author of the Python script you linked.

    I didn’t write it because deleting all thing in a given search wasn’t possible before, the use of that script is automation: It’s useful to be run every day in the background, throwing away old emails you don’t care about (like for example old mailing list posts that you will not have time to read anyways).
    You can run my script from some random server on the internet and never have to delete those things manually.
    Just thought I’d clear that up.

  2. Martin

    Thanks for clearing that up. Looking again, your script is actually really valuable. I’d like to see more automated cleaning jobs like this out of the box.

  3. tante

    Well, if you have any ideas for more cleanup things that could be done, I’m all ears :)

Leave a Reply