Gmail’s Filters Ultimate Guide

Image Credits: Google

Gmail is probably one of the best products from Google, it’s more than a service to send and receive emails. It has so many powerful features to help us manage the constant myriad of messages and some of them are especially handy in these times of increased remote work. 

In this guide, we’re going to save you hours of managing your inbox. 

The basics

Gmail has a large search bar at the top of the screen, most of us use it to search for names or phrases. These searches include results from an email’s subject field, senders, and message contents. 

Unfortunately sometimes gives us too many messages to go through/ This is where filters come in handy to trim the results down to a more manageable size.

There are a few small buttons that appear on search pages. They are called ‘chips,’ and they can help us filter results without opening the Advanced Search panel or typing our own filters. For example, clicking the ‘Has attachment’ chip will hide all messages that don’t have an attached file.

Simple words and phrases combined with Gmail’s chips will help us to find the exact messages we’re looking for. But what if you want to set up permanent filters for specific searches? That’s where Gmail’s advanced search functionality comes into play.

Advanced search

You can see the ‘Advanced search’ link that appears below the search bar after we search for something. The advanced search is a popup with various fields to help us narrow down the results. With them, we’ll be able to filter messages by date, size, sender name, subject, etc.

The advanced search popup has also two buttons at the bottom. One shows us the results for whatever we type in, the other ‘Create filter’ to create a message filter with the options we chose. If we chose this one it will take us to a second screen, where we’d be able to define exactly what happens to messages that the filter catches.

Once we made our choices to set the filter how we want it, we click the ‘Create filter’ button and activate the filter. By default, filters do nothing to existing messages, but we can change this by clicking the checkbox for ‘Also apply a filter to matching conversations.’

To access all our saved filters we go to Gmail’s settings (click the Settings gear -> ‘See all settings’) and clicking the tab for ‘Filters and Blocked Addresses.’ We can export all filters to an XML file, to export them to another Gmail account.

Let’s give a few examples of Gmail filters. Let’s say we are subscribed to a few newsletters, but we don’t want them mixed with our regular messages in our inbox. A simple way to do this is creating a filter with “Unsubscribe” in the “Has the words” field, then setting it to skip the inbox and apply a label (e.g. make a new one called ‘Newsletters’). Then we could check our newsletters any time by clicking the proper label in the Gmail sidebar, instead of seeing them pile up on our inbox.

Another example could be, let’s say a certain company keeps emailing us with spam. Gmail allows you to block addresses or multiple addresses. We create a filter with an asterisk (*) in parts of the field, which functions as a wildcard. For example, typing “*” in the From field would match all emails with the domain After we have a search set up, we can set the filter to automatically delete all matching emails.

Multi-step filters and basic operators

Gmail’s search/filter interface adds terms like “from:” or “to:” or “subject:” to the search field. These are called search operators and can be combined to trim down your results. Gmail types these for you when you use the search interface, but once we understand how they work, we can make our own searches and filters typing directly into the search bar.

Let’s say you wanted to search for all your delivery emails from We could type something in the search bar, which would show messages sent from any Etsy address with the word “delivery” in the email somewhere:

from:* “delivery”

However, this might not catch all delivery emails. If our package wasn’t delivered, the email might not say “delivery” exactly. Adding additional terms like “package” or “order” will give us better results. This is where Gmail’s “OR” operator comes in. Here’s an updated example:

from:* (“delivery” OR “package” OR “order”)

Now we use parentheses to add nested logic to the filter. In the above example, two factors have to be true: the email has to be from Etsy, and it must contain either “delivery,” “package,” or “order.” If we want to keep going and add more retail stores, we could do something like this:

from:(* OR * OR * (“delivery” OR “package” OR “order”) 

Now we have a search that looks for emails from Etsy, eBay, and Alibaba with the phrases specified in the second half. If it helps readability, we can also add “AND” to the middle (between the two sets of parentheses), and Gmail will still understand us.

Hidden operators and filters

Gmail has more operators and filter options than the advanced search popup shows. We can sort by attachments, file type, links to Google Drive files or YouTube videos, dates, messages from Google Chat, message size, and much more. Below is the full list of filters from the Gmail support website, as of January 2020.

What you can search bySearch operator & example
Specify the senderfrom:
Example: from:amy
Specify a recipientto:
Example: to:david
Specify a recipient who received a copycc: bcc:
Example: cc:david
Words in the subject linesubject:
Example: subject:dinner
Messages that match multiple termsOR or { }
Example: from:amy OR from:david
Example: {from:amy from:david}
Remove messages from your results
Example: dinner -movie
Find messages with words near each other. Use the number to say how many words apart the words can be Add quotes to find messages in which the word you put first stays first.AROUND
Example: holiday AROUND 10 vacation
Example: “secret AROUND 25 birthday”
Messages that have a certain labellabel:
Example: label:friends
Messages that have an attachmenthas:attachment
Example: has:attachment
Messages that have a Google Drive, Docs, Sheets, or Slides attachment or linkhas:drive
Messages that have a YouTube videohas:youtube
Messages from a mailing listlist:
Example: list:[email protected]
Attachments with a certain name or file typefilename:
Example: filename:pdf Example: filename:homework.txt
Search for an exact word or phrase” “
Example: “dinner and movie tonight”
Group multiple search terms together( )
Example: subject:(dinner movie)
Messages in any folder, including Spam and Trashin:anywhere
Example: in:anywhere movie
Search for messages that are marked as importantis:important label:important
Starred, snoozed, unread, or read messagesis:starred
Messages that include an icon of a certain colorhas:yellow-star
Recipients in the cc or bcc fieldcc: bcc:
Example: cc:david
Note: You can’t find messages that you received on bcc.
Search for messages sent during a certain time periodafter: before: older: newer:
Example: after:2004/04/16
Example: after:04/16/2004
Search for messages older or newer than a time period using d (day), m (month), and y (year)older_than: newer_than:
Example: newer_than:2d
Chat messagesis:chat
Example: is:chat movie
Search by email for delivered messagesdeliveredto:
Example: deliveredto:[email protected]
Messages in a certain categorycategory:primary
Messages larger than a certain size in bytessize:
Example: size:1000000
Messages larger or smaller than a certain size in byteslarger: smaller:
Example: larger:10M
Results that match a word exactly+
Example: +unicorn
Messages with a certain message-id headerRfc822msgid:
Example: rfc822msgid:[email protected]
Messages that have or don’t have a labelhas:userlabels has:nouserlabels
Example: has:nouserlabels
Note: Labels are only added to a message, and not an entire conversation.

Let’s go over a few helpful examples that use the above operators. Maybe we are a patient with a doctor who sent out a message with an important document attached, but we can’t find it. Something like the below search could help you out:

from:[email protected]  has:attachment

Another helpful search is using the “size” operator to look for large messages that may be cutting into our Gmail/Google account storage. The below example would find all messages 10 MB or larger:


In terms of filters, maybe our friends and family are constantly sending you videos, and we want to keep them all in one easy-to-access location. We can use a search like the one below, then create a filter with it that adds a label like ‘Videos’:

has:youtube OR “” OR “”  OR “”

However, there is one issue that affects filters like the one above — Gmail doesn’t have a way to search by link URLs. For example, the above filter would only work for messages where the link’s text was the URL. The filter would catch messages that spelled out “” or “”, but not messages where the link text said something different.

Share with friends:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.