20 Ways to Use Gmail Filters

One of the coolest things about Gmail is its filters — set up properly, filters can add loads of functionality to your already-powerful Gmail account. Save time and space, rid your inbox of unwanted emails, and turn your Gmail into a multi-functional tool with simple filters.
There are some limitations to Gmail’s filters that I’d like to see improved in the future, including:
- the inability to mark a post as read
- the inability to create live “smart folders”
- difficulty in adding a large number of email addresses to a filter
But all in all, the filter function is very cool. Here are some ideas for how to use it:
- Killfile. If people send me too much junk mail (jokes, chain mail, etc.), they get added to my killfile. It’s a simple filter that looks at the “from” field and deletes the message if it’s one of the addresses I’ve added to the filter. Every now and then I’ll decide to add someone to my killfile, and I’ll just open up the filter and add their address.
- Booleans. The filter works much like Gmail’s search function, in that you can add search terms such as AND or OR or NOT. So I can look for addresses that are from a number of people (using OR), or emails that must include all of the words on a list (using AND). Use search operator symbols to make it even easier: “|” for OR, space for AND, “-” for NOT, and parentheses to group different terms in your search string.
- Other search terms. Beyond the common terms above, your filters can use other terms such as “from:”, “to:”, “has:”, “is:”, “filename:”, and “label:”, among others. Using these terms, you can make your filters even more powerful.
- Send reminders to someone. One of the things I wish Google would add to Gmail is the ability to send a delayed email. This would allow me to send reminders to someone at regular times. Instead, I sign up for a reminder email service to send reminders (meant for other people) to my gmail address, and then set up filters to forward the reminders to various people depending on the subject or content of the email. It’s not perfect, but it allows me to send reminders to different people on a regular basis.
- Calendar and log. I set up Google Calendar to send me reminders of events. You can set up a label (”events”) so that your calendar reminders go straight to the label, star the message, and skip the inbox. Now not only are your events in one place, instead of scattered through your inbox, you can unstar the message when you complete the task or event, and now you also have a log of all the things you’ve done.
- To-dos. This is a commonly used function, but you can email yourself tasks that you need to do, and then set up a filter that has your email address in both the “to” and “from” boxes, that applies the label “to-do” to the message. This will allow you to view all your to-dos in one filter. Or, if you’re a GTD fan, you could set up to-dos for each context (@work, @home, @errands, @phone, etc.), by creating different labels for each, and then setting up filters for different email addresses. Email yourself at yourname+work (you don’t need the @gmail.com part), and set up the filter to label that address “@work”, and so on for each context.
- Follow up. Even if you’re not a GTD fan, having a follow-up label is a must. Simply set up a filter with an email address such as “youname+follow” and put it in the “has the words” filter field, and have this filter label it “@follow” and skip the inbox. Now when you send out an email that needs to be followed up on, put yourname+follow in the “bcc” field, and it’ll go into your “@follow” label. Be sure to check this label once a day so you can follow up on your emails.
- Send spam to trash. Instead of having Gmail-filtered spam go into your Spam folder (and have the annoying count of unread spam by the folder’s name), set up a filter with “is:spam” in the “has the words” field (just click “OK” on Gmail’s warning dialog box when you click next step) and “Delete it” as the action. Now all spam messages will go in your trash.
- Archived bookmarks. If you use del.icio.us and other bookmarking services, you can archive them all in a Gmail label (”bookmarks”). Get the feed urls for each of your bookmarking services, enter them in a forwarding service such as rssfwd.com, and then set up a filter to label them all “bookmarks”. Now all your bookmarks are in one place, with Gmail’s great search.
- Attachments. If you’re like me, you like to go through your old emails and delete a bunch of them at a time. I do common searches during the cleanup process, such as “has:attachment”, so that I can look through all my bigger emails and delete them. Make this process quicker by making a label and filter for this search, and for any of your common searches, for that matter.
- Media. If you get a lot of media sent to you, such as music files, videos and photos, set up filters (”filename:wmv | filename:mov” for videos, “filename:mp3″ for music, filename:jpg | filename:gif” for photos, or “filename:pdf | filename:doc” for documents). Now you can quickly find any media.
- Backups. Create a second Gmail account for storage, and create a filter to automatically forward any emails with attachments (”has:attachments”) to this second address. Now you can delete your old emails without guilt or worry.
- Newsgroups or feeds. You can set up filters for your newsgroups, so they don’t clog up your inbox. Or forward your favorite feeds to your Gmail, and automatically label and archive them for later reading. Now you can not only access them from anywhere, but you can search them too.
- Bloggers. If you run a blog, you can have all your blog’s comments and pingbacks automatically archived and labeled (”blog”), so your inbox doesn’t get filled up fast. Also have your blog stat reports mailed to you and shunted to this label, so you can get a quick look at your blog’s success at a glance.
- Delete old sent emails. There’s no reason, in most cases, to keep your really old sent emails. Delete them. Create a filter with “before:2006/06/01 label:sent” with “Delete it” as the action (you’ll need to click “OK” to Gmail’s warning dialog). Every month or so, update the date of this filter.
- No delete. Some emails you don’t want to delete — those precious ones from your kids, for example, or maybe ones from your boss. Set up a label (”nodelete”) and a filter that puts the nodelete label on emails from (or to) the addresses you want. Now, some of the above filters, add the string “-nodelete” so that it doesn’t show these emails. Now you can delete your old sent emails, or your attachment emails, for example, without worry that your kids’ or boss’ emails will be trashed along with the rest of the riffraff.
- Flickr. Forward your Flickr account’s feed to your Gmail, with a filter to automatically label it, and now your photos are searchable through Gmail. You can also set up filters to send notices that certain tags in your Flickr account has new photos to certain relatives.
- Notes. Email yourself notes on web research, on meetings, on books you’re reading, on classes you’re taking. Set up a filter to archive and label them (if you send notes to yourname+notes, for example). Now they’re searchable and archived and accessible from anywhere.
- Twitter. Use your mobile phone to send text messages or IM messages to Twitter, with a keyword at the beginning of each Twitter message (NOTE, TODO, BLOG, FOLLOW, etc.). Forward your Twitter account’s feed to your Gmail, and set up filters for each type of keyword (”note twitter” will be labeled “note” for example). Now you can use your mobile device to send notes, to-dos, follow-up reminders and more to your Gmail through Twitter.
- Wildcard. Use the wildcard character (*) for companies that use multiple types of address from the same domain. One great use I’ve seen is to use the wildcard character for vendors such as Amazon or eBay to make it easier to track online purchases. Create a label (”online shopping”) and a filter with such email addresses as “*@amazon.com|*@ebay.com|*@paypal.com|*@barnesandnoble.com”.



Comments
Travis says on May 29th, 2007 at 11:17 am
Awesome tips! I especially like the one about setting up an archival gmail account. How come I never thought of that??
Techie Buzz says on May 29th, 2007 at 12:23 pm
Great list, I absolutely liked the bookmarking filter and will definitely put it to use.
There are many new things which will play around with, thanks for the info.
Keith
tm says on May 29th, 2007 at 6:23 pm
i don’t understand the references to email addresses for labels - eg Simply set up a filter with an email address such as “youname+follow”
Can you clarify what you mean? GThanks
TM says on May 29th, 2007 at 6:39 pm
How do you forward your flickr feed to your email?
Thanks!
Leo Babauta says on May 29th, 2007 at 7:08 pm
Hi TM,
1) What I mean is that if your Gmail address is tm@gmail.com, for example, when you send an email that you want to follow up on, you put the address tm+follow in the bcc field — Gmail allows you to add things to your email address like this with the + sign and still processes it as if it’s your regular address. Then, go and set up a filter with “tm+follow” in the “has the words” field, with the action of the filter applying the label “follow” to the email. I hope this is clearer?
2) To forward your flickr feed, get the url of your flickr feed on your flickr page, then enter it into a forwarding service such as rssforward.com, with your email address.
Niels says on May 29th, 2007 at 7:30 pm
Great post again Leo!
Ed says on May 30th, 2007 at 12:34 am
Great post, very good read.
Delete old sent emails. says on May 30th, 2007 at 2:29 am
Re: Delete old sent emails
How do you delete only your original message and not your friend’s reply, since Gmail aggregates all the messages into a conversation?
StarCraft 2 Wallpapers says on May 30th, 2007 at 3:40 am
nice list! good work!
Sypher says on May 30th, 2007 at 5:20 am
I’d like to be able to create a second spam box.
So emails from only one address are stored for X amount of days and then dumped or deleted.
Keith says on May 30th, 2007 at 6:52 am
Normally, I just manually selected those mails that I don’t need in GMail and delete them directly.
Brant says on May 30th, 2007 at 7:10 am
Hi - When I try and add my email address+followup I get an error box stating, “Please make sure email addresses have no spaces and at least one @ sign”
Brant says on May 30th, 2007 at 7:11 am
Hi when I try and add an email address in the format myname+followup I get an error stating that I should have at lease one @ sign in it.
Victory says on May 30th, 2007 at 7:19 am
Awesome tips but I also wanted to know if you could use filters to automatically delete emails after a certain age. For instance I’m a subscriber to a couple online newsletters so I’ve already got those sorted out to their own ‘folder’ labels, but I wanted to be able to automatically delete these emails when they reach say 3 months old.
Any ideas on how to do that?
Denny says on May 30th, 2007 at 8:39 am
Another quick tip concerning email backups: if you like to backup _all_ your email, that is forwarding _all_ your email to a second gmail account, simply create a filter where the filed “hasn’t the words” contains some obscure string, like “some-obscure-string-that-is-very-unlikely-to-happen”. Now every email which does not contain that string - should be 100% of the incoming email - will be matched by the filter.
Chad says on May 30th, 2007 at 9:59 am
I also get an error when I try the “yourname+label” format in the To, Cc, or Bcc fields… How are you making this work? This sounds too good to be true…
Jesse says on May 30th, 2007 at 10:04 am
Re: the “yourname+label” questions -
If you add a + to your email name, Gmail basically ignores everything after the + but before the @. So an incoming email to yourname+yourlabel@gmail.com will simply go to the inbox of yourname@gmail.com
Now when you set up a FILTER for “To” with the recipient name “yourname+yourlabel@gmail.com”, it watches for that whole string, +yourlabel included.
So, as suggested above, I set up a myname+notes@gmail.com filter. Now I can just send myself an email to myname+notes@gmail.com, and it automatically skips my inbox and puts it in a Notes label I created.
robert einhimenah says on May 30th, 2007 at 11:08 am
ewhtjhihkojhgihbjtioritgoriungytproyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo00000000000000000000000000000000000000000000000011111111111188888888884444444444444444444444444444433333333333330000000000000000000000000000000000000000000002222222222222222222225888888888888888888888883333333333333333333333333333333333-853-0853906-027890286905486758921194376575975730-7654765894027896089307869507802376584-37-267589037280564892906780964782-78667-31786-28678367804678903789175-6481589026830268-2\14=678256782195306894p2980-4337865-42-06759042-76892-7589259403926592-652790-6725-672-67-3294-=2657430-7620962-0678032782786-790-729-2786-763-63789-62789046729572956798291421-98-502-78920468390268202890643068750460q675436702890582791785-8278509432-50583-82356-
John says on May 30th, 2007 at 11:16 am
These are some great tips. I already set up the bookmark filter with delicious and rssforward. Is there a way to get all of old bookmarks through this? It only adds sites that I’ve tagged recently, and I’d like to be able to have all my bookmarks.
JT says on May 30th, 2007 at 12:55 pm
Great tip about setting up a second account for backing up email.
Denny:
Instead of using the filter to forward all emails; GMail has a forward email function under settings.
KStone says on May 30th, 2007 at 1:05 pm
So useful. Thx! This is not related to filters, but do you know if there is a way to add a contact to a group right from the “compose email” area?
Here’s the scenario, I have a new contact. I want to add them to contacts and send them an email in one swoop. Is this possible?
thx
Mister EDgAr h says on May 30th, 2007 at 1:12 pm
“difficulty in adding a large number of email addresses to a filter”
You’re kidding right?? Add “OR” in between 2 emails.. What’s so hard in this?? ‘You simple or something?
Lackey says on May 30th, 2007 at 2:02 pm
hhahaa
Denny says on May 30th, 2007 at 4:48 pm
JT: you’re right, I forgot about that…

BUT, just in case you want to forward your mails to multiple accounts… you have to use filters
Walt says on May 31st, 2007 at 3:40 am
Your “Archived bookmarks” tips sounds great for my del.icio.us bookmarks…but I’m not sure how to make it work. Can you explain it in more detail?
Thanks!
Walt says on May 31st, 2007 at 3:41 am
Your “Archived bookmarks” tip sounds great for my del.icio.us bookmarks…but I’m not sure how to make it work. Can you explain it in more detail?
Thanks!
Steve says on May 31st, 2007 at 4:57 am
Does anyone have a solution?
“How do you delete only your original message and not your friend’s reply, since Gmail aggregates all the messages into a conversation”
Jesse says on May 31st, 2007 at 8:28 am
Re: Walt - “Your “Archived bookmarks” tips sounds great for my del.icio.us bookmarks…but I’m not sure how to make it work. Can you explain it in more detail?”
Simply go to your bookmark aggregator (del.icio.us, etc), login and find the link for the RSS feed of your bookmarks - it’s usually an orange RSS icon. Right click on that and press “Copy Link Location”. Then go to http://www.rssfwd.com, paste in that link in the URL box, and then enter your email address. All new bookmarks that you add to your del.icio.us account will then be automatically forwarded to your Gmail inbox.
Then in Gmail, create a new filter with the “From” category = rssfwd@rssfwd.com, and the “Subject” field = the subject of the rssfwd emails. For del.icio.us forwards, the subject line should always read “del.icio.us/yourusername”. So put that line in the “Subject” field in the filter, so that you can set up other filters from rssfwd@rssfwd.com with their own distinct subject filters if you like.
For example, you could have two filters set up from rssfwd@rssfwd.com: One with the subject “Photos from yourusername”, that is a feed of all your Flickr photos, and the other with the subject “del.icio.us/yourusername”, for your latest bookmarks.
Walt says on June 3rd, 2007 at 3:23 am
Thanks Jesse for your explanation about “Archived bookmarks.” That worked perfectly.
Question: I have a few thousand old bookmarks in del.icio.us. Is there any way to get those into Gmail also?
vikram says on July 20th, 2007 at 9:32 am
i can’t understand -nodelete if i delete any file it will deleted under all the labels. how can i get it back?
How to safe guard my important mails.
you can mail me..
gsv.vikram@gmail.com
Not Nurse Ratched says on July 25th, 2007 at 11:40 am
Is there a way to set up filters for e-mails that do NOT have attachments?
Dona says on August 3rd, 2007 at 6:06 pm
and how to make a condition that the filter should run for anybody in this group, I mean if you create a group (to make it easy to sent email, it should also be helpful for geting email). so i want to create a filter that it should run if in field from is anybody from where friends is this group
from: in
??? doesn’t work any other ideas…??
Adamo says on August 21st, 2007 at 11:03 am
Q: what is the purpose of the bookmarks (del.icio.us) one? Unless one can archive them to them be imported or uploaded to another account or service then I’m not seeing the point.
Enlighten me to why one needs a bookmarks filter.
Bobby says on September 25th, 2007 at 8:47 am
Could someone tell me how to use the “label:” search in a filter. When I try this, gmail says that such a filter will never match incoming email.
Jack says on October 29th, 2007 at 8:14 am
nice list, Leo
P.I.Julius says on December 22nd, 2007 at 9:06 am
One thing, how can you filter only by the content of the message? saying: i get an email at xxxx@pijulius.com and I wan to make a filter that if in the email my name is written “Julius” it should be labeled as Important, the problem is that if I put the filter into “Has the words:” it will match the email address too so every email that is send tp pijulius.com will be marked as important even if there is nowhere mentioned my name in the email. And please note, I can’t add a filter to negate the email to for julius cos I have many emails and only a few of the are sent to the pijulius domain.
So bottom line, is it possible to filter only by the content of the email not the whole source of it?
Thanks!!!
josh says on January 15th, 2008 at 5:40 pm
Thanks for these ideas on using gmail filters.
Cheers
Tony says on January 22nd, 2008 at 5:11 pm
Good tips
Lyse says on January 24th, 2008 at 3:53 pm
Great article, thanks a lot
BillyB says on January 28th, 2008 at 10:23 am
I hate those chan mails! Thanks a lot for the tip.
BillyB says on January 28th, 2008 at 10:23 am
I hate those chain mails! Thanks a lot for the tip.
Jason Simpson says on February 17th, 2008 at 2:26 am
thanks for bringing this up.. gmail has a lot of feature that makes life easier.. we just need to hit the right button..
David Baker says on March 1st, 2008 at 6:18 pm
“Forward your Flickr account’s feed to your Gmail, with a filter to automatically label it, and now your photos are searchable through Gmail.” - Wow! Loved it.
Jones says on March 27th, 2008 at 5:36 pm
I hate those chain mails! Thanks a lot for the tip.