Useful gmail filters


Useful gmail filters

It seems like I've been writing a lot about email lately, thanks to frequent conversations on twitter about how I manage my email. I was talking today with @antifuchs and realized that people may not be using the power of gmail filters and labels.

Automatically filtering and labeling allows me to batch process my email without a ton of context switching. The filters below are the ones that I think will apply to the most people, but ultimately you'll create filters and labels based on your own workflow, the kinds of emails you receive, and the actions you need to take on them.

If you aren't currently using filters and labels, I would highly recommend it. I've seen a lot of people whose email inboxes have multiple hundreds of emails in them and it scares me. Yes, you can just search for what you need when you need it, but the mind clutter that comes with staring at hundreds of emails is something I don't want. Filters and labels are easy to create, and can be made in 1 of 3 ways depending on your workflow.

How to create filters

These are my two favorite ways:

Create filter from the list view

Use the search bar to find the emails you want to filter. If you need a refresher on the search syntax, google made a handy page for that. :)

This will produce a list of emails that meet that criteria. Make sure this includes all of the emails you want to create a filter for and nothing you don't want. Sometimes you need to add a -[search words] or AND [search words]

Next, click the small gray arrow next to the search. This will give you additional options to filter down.

Once you have the filter looking the way you want it to, click the "create filter with this search>>" link. This will give you options for the action gmail will perform on the emails. Remember that filters are only applied on emails when they are received: additional actions cannot be performed on them automatically after they've been received.

At the bottom of the options you will see a "Apply filter to matching conversations.". Check that box, and then click "create filter.".

Create filter from the email view

If you're already in an email that meets the criteria that you want to filter, you can click the down arrow next to the reply button and choose the "Filter messages like this" link.

This will start creating the filter for you like above. Make sure this includes all of the emails you want to create a filter for and nothing you don't want. Sometimes you need to add a -[search words] or AND [search words]. 

Once you have the filter looking the way you want it to, click the "create filter with this search>>" link. This will give you options for the action gmail will perform on the emails. Remember that filters are only applied on emails when they are received. Additional actions cannot be performed on them automatically after they've been received.

At the bottom of the options you will see a "Apply filter to matching conversations.". Check that box, and then click "create filter.".

How to create Labels

Labels are a bit more straightforward. You can create them from the left sidebar where the other labels already are.

\

You can also create them from the Create a filter interface.

The neat thing about labels is that you can nest them to create a hierarchy or to keep things organized. For instance, the top level labels I have are ham (children include twitter, facebook, etc), lists (children include each of the separate lists I subscribe to), and purchases (children include amazon, itunes, etc).

Filter by email address sent to

If you have your email set up similarly to mine, you probably have multiple email addresses forwarding to one inbox. For this, I have set up a filter for each of my email addresses that let me quickly see the account the email was sent to. This works best if you use each email account for separate things. For instance, I have a separate email address for my contracting work, some clients have given me an email address on their domain to reply to their clients with, etc. All of those email addresses automatically have the Work tag applied to them in addition to any more specific tags, like the name of the client or project.

Matches: to: ([email protected])

Do This: Skip Inbox, Apply label "Work"

 

Matches: to: ([email protected])

Do This: Skip Inbox, Apple label "Client or Project Name"

Filter by email address sent to +ham/+spam

Gmail gives you the ability to add a +[word] to the end of your email address that you can use to act as an automatic way to tag things. For instance, if I am forced to create an account for something to read an article, I will give them the email address [email protected] (note: not all services allow you to sign up with an email address including the + character). Then I have a filter that looks for [email protected] and automatically applies the Ham tag to it, and archives it from the inbox.

Matches: to: ([email protected])

Do This: Skip Inbox, Apply label "Ham"

Filter marketing emails

This one is my favorite and the one I recommend to people most often. With how frequently I end up on marketing email lists, I spend a lot of time unsubscribing from them. I created this filter so I can go through these once a week or once a month and unsubscribe from what I don't want. If you never want marketing emails, you can have your filter mark these as spam and gmail will attempt to unsubscribe you from the emails, just be aware you may accidentally mark something as spam that isn't.

Matches: "unsubscribe"

Do This: Skip Inbox, Apply label "Unsubscribe"

Filter social media emails, github notifications, and similar automated emails

This one is pretty obvious. I have each of these social media accounts set up to only send me the emails I want, but I still don't want them littering my main inbox. I add to this filter each time I sign up for a new service.

Matches: from:((*@postmaster.twitter.com) OR (*@mailer.last.fm) OR (*@linkedin.com) OR (*@soup.io) OR (*@tumblr.com) OR (*@facebookmail.com) OR  (*@mail.ilike.com) OR (*@meetup.com) OR (*@youtube.com) OR (*@community.current.com) OR (*@myopenid.com) OR (*@upcoming.org) OR   (*@mail.dailymile.com) OR (*@doodle.com))

Do this: Skip Inbox, Apply label "ham"

If you are involved with a lot of projects on github, you are probably drowning in github emails as well. I have a separate filter for each of the projects I subscribe to.

Matches: from:(noreply@github.com) "[projectname]"
Do this: Skip Inbox, Apply label "github/projectname"

Filter mailing lists

Gmail automatically recognizes lists, which is pretty neat. In the "Has the words" field of the filter, enter list:(<[email protected]>) and hit the search button. You should have a list of all items from the list. I have quite a few of these.

Matches: list:(<chrome-notebook-pilot-users.googlegroups.com>)
Do this: Skip Inbox, Apply label "List/Chromebook"

Suggestions

I'm always interested in hearing other people's tips and tricks to automatically managing their email. Do you have a neat filter set up?

Support Diversity in Tech

95% of funding for my over 1500hrs community work per year - including this and other free online resources, AlterConf, and Fund Club - comes from donations.

Donate Now