How To Create Filters In Gmail To Sort Mail (2026)

A Gmail filter sorts new mail for you by labeling, archiving, starring, deleting or forwarding it as it arrives.

You build one from the search box at the top of Gmail on a computer, and it takes about a minute.

The steps below follow Google’s Gmail Help pages for filters, search operators and organizing mail.

Quick answer: create a filter in Gmail

TaskHow to do it
Create a filterClick Show search options in the search box, enter criteria, click Create filter, choose an action, click Create filter
Create one from an emailCheck the email, click More, click Filter messages like these
Edit or delete a filterSettings, See all settings, Filters and Blocked Addresses, Edit or Delete
Export or import filtersFilters and Blocked Addresses, Export or Import filters

Create a filter from the search box

  1. Open Gmail on your computer.
  2. In the search box at the top, click the Show search options icon.
  3. Enter your search criteria.
  4. Optional: click Search first to see which emails match.
  5. At the bottom of the search window, click Create filter.
  6. Choose the action you want the filter to take.
  7. Click Create filter.

The filter then applies to the mail that matches your criteria.

Create a filter from an email you already have

  1. Open Gmail and check the box next to the email.
  2. Click More.
  3. Click Filter messages like these.
  4. Enter or adjust the filter criteria.
  5. Click Create filter.

This is the quickest way to filter a sender you keep receiving mail from.

What a filter can do

Google’s filter page lists these actions when you create a filter.

ActionWhat it does
LabelPuts a label on matching mail so it is easy to find in the left panel
ArchiveRemoves matching mail from the inbox while it stays in All Mail
StarMarks matching mail with a star
DeleteDeletes matching mail
ForwardForwards matching mail to an address you have set up

Be careful with the delete action, because a filter that matches too much can remove mail you wanted.

Search operators you can use for the criteria

Filters use the same search criteria as Gmail search, so these operators from Google’s search page work.

OperatorWhat it findsExample
from:Mail sent by a personfrom:[email protected]
to:Mail sent to a personto:[email protected]
subject:A word or phrase in the subject linesubject:dinner
has:attachmentMail with an attachmenthas:attachment
filename:Attachments with a certain name or typefilename:pdf
larger:Mail larger than a sizelarger:10M
list:Mail from a mailing listlist:[email protected]
label:Mail under a labellabel:important

Combine criteria

  • OR or braces match one or more criteria, such as from:amy OR from:david.
  • AND matches all criteria, such as from:amy AND to:david.
  • A minus sign excludes mail, such as dinner -movie.
  • Quotation marks match an exact phrase, such as “dinner and movie tonight”.
  • Parentheses group terms, such as subject:(dinner movie).

More operators for narrower filters

Google’s search page lists many more operators that you can type into the criteria.

OperatorWhat it findsExample
cc: and bcc:Mail that includes a person in the Cc or Bcc fieldcc:[email protected]
newer_than: and older_than:Mail newer or older than a period, using d, m or ynewer_than:2d
after: and before:Mail received within a date rangeafter:2004/04/16
category:Mail in an inbox category such as primary, social, promotions, updates or forumscategory:promotions
is:Mail with a status such as important, starred, unread or readis:unread
deliveredto:Mail delivered to a specific addressdeliveredto:[email protected]
in:anywhereSearches all of Gmail, including Spam and Trashin:anywhere

Filtering calendar invitations

Google gives calendar invitations as a case where filters help when you receive a high volume of them.

Its tip is to filter by specific notification types, such as archiving routine accepted invitations.

Test the criteria before you save

Click Search in the search window first, so you can see which emails the criteria match.

If the list includes mail you do not want filtered, change the criteria before you click Create filter.

Filters and mail you already have

Google’s filter page does not describe applying a filter to older conversations.

To organize mail already in your inbox, search for it, check the messages and use Labels at the top.

Google says a forwarding filter applies only to new messages, so existing mail is not forwarded.

Replies are filtered only if they match

According to Google, a reply to a filtered message is not caught automatically.

It is filtered only when the reply itself meets the filter’s search conditions.

You can put several operators together in one filter, for example a sender plus has:attachment, so that only matching mail is touched.

Start with narrow criteria and widen them later, because it is easier to add mail to a filter than to find what a broad filter hid.

Edit or delete a filter

  1. Click Settings at the top right, then See all settings.
  2. Click Filters and Blocked Addresses.
  3. Find the filter you want to change.
  4. Click Edit to change it, or Delete to remove it.
  5. If you edit, click Continue when finished.
  6. Click Update filter or OK.

Export or import your filters

ActionSteps
ExportIn Filters and Blocked Addresses, check the box next to the filters, then click Export at the bottom for an .xml file
ImportClick Import filters at the bottom, choose the filter file, click Open file, then click Create filters

Google says the exported .xml file can be edited in a text editor.

Filters compared with other ways to sort mail

Google notes that Gmail filters do not need to run on a schedule the way Outlook rules do.

ToolWhat it does
FilterSorts matching mail automatically as it arrives
MuteSends future replies in a thread straight to the archive
SnoozeReturns a message to the inbox at a day and time you choose

If a filter is not doing what you expect

Open Filters and Blocked Addresses and check that the criteria are what you meant and the action is correct.

Our guide to Gmail forwarding and filters not working covers the common causes.

Sources

Leave a Reply

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