Gmail's help article for this is titled "Create rules to filter your emails," and the product name on the screen is filter. There is no separate Rules menu. A rule and a filter are the same control: when a message matches what you specify, Gmail labels it, archives it, deletes it, stars it, or forwards it.
You set that up on a computer. Google's Android and iPhone help both say you must open Gmail on a computer to create a filter. The Gmail app does not include the control. Once the filter exists, it runs on the account, so new mail is handled even if you only read Gmail on your phone.
Create a filter
These are Google's steps from Create rules to filter your emails:
- Open Gmail on a computer.
- In the search box at the top, click Show search options.
- Enter the search criteria. Click Search if you want to see which messages match before you save anything.
- At the bottom of the search window, click Create filter.
- Choose what the filter should do. This is also where Also apply filter to matching conversations sits, covered below.
- Click Create filter.
The same screen is available from Settings (the gear icon), See all settings, Filters and Blocked Addresses, then Create a new filter at the bottom of that tab. That tab is also where you edit, delete, export, and import filters later.
Click Search before Create filter whenever the action is Delete it. The results are the messages the filter will catch. If a person you still need is in that list, tighten From or add a word under Doesn't have and search again.
What a filter can match
The search window is an AND. A message has to match every field you fill in. From billing@store.example plus Subject receipt catches that sender's receipts, and skips their newsletters.
Useful fields:
- From and To take one address, or a whole domain.
*@example.comin From matches everyone at that domain. The same search typed as a query isfrom:(@example.com). - Subject matches the subject line. Quotes make it a phrase:
"Project Update". - Has the words searches the message, and it is where operators go when the fields are too narrow.
larger:10M,has:attachment, andis:unreadbelong here. - Doesn't have excludes a word or address. Type the word on its own. The field is already the exclusion, so a leading minus is the wrong place for it.
- Size is greater than or less than a size you set. Has attachment limits the filter to messages with a file.
Several senders in one filter: put {from:a@example.com from:b@example.com} in Has the words, or from:(a@example.com OR b@example.com). OR has to be uppercase. A lowercase "or" is searched as a normal word. Parentheses group the terms: from:(amy OR david) subject:meeting.
A minus in Has the words excludes one address inside a broader match: from:*@example.com -from:boss@example.com.
is:unread only describes the message at the moment it arrives. The filter does not go back and remove a label after you read it.
What the filter can do
Google's help names the actions as label, archive, delete, star, and automatic forward. On the create-filter screen those show up as checkboxes, and a few more sit beside them:
- Skip the Inbox (Archive it) files the message in All Mail.
- Mark as read
- Star it
- Apply the label, then pick or create the label
- Forward it to an address you have already confirmed as a forwarding address
- Delete it, which moves the message to Trash
- Never send it to Spam
- Always mark it as important
- Categorize as, for a tab such as Promotions or Updates
You can check more than one. Archive plus a label is the usual pair for receipts: out of the inbox, still easy to open later.
Two limits are written on Google's help page, and they surprise people:
- A forward filter affects new messages. It does not forward mail that is already in the account.
- When someone replies to a message you filtered, the reply is filtered only if that reply itself matches the same search. A filter on one subject line will miss the reply if the subject changed.
Delete it sends mail to Trash. It does not send mail to Spam. There is no "send it to Spam" checkbox. Never send it to Spam is the spam-related one, and it does the opposite. Blocking a single address is a different control: how to block emails on Gmail. Block files later mail from that one address in Spam. A filter is what you use for a domain, a keyword, or an action other than Spam.
Delete it and Skip the Inbox are also why new mail looks like it never arrived. The checklist, starting with a full account, is Gmail not receiving emails.
Trash still counts toward storage until you empty it or 30 days pass.
Apply a filter to email you already have
This is the checkbox Also apply filter to matching conversations, on the same screen as the actions.
Leave it unchecked and the filter waits for new mail. Check it and Gmail runs those actions once on conversations already in the account that match the search. Click Search on the criteria screen first so you can see that set. For a delete filter, that preview is the mail about to land in Trash.
The checkbox is a one-time pass. The next time you open the filter it is unchecked again. That is expected. You do not need it to stay on for new mail. The saved filter handles messages as they arrive. Check it again later only when you want another pass over whatever is already there: Settings, See all settings, Filters and Blocked Addresses, Edit, Continue, check the box, Update filter.
Forwarding is the exception Google calls out. Checking the box does not forward old messages. Forwarding still applies only to new mail.
A reply already in the thread is included only when that reply matches the search. Matching "the conversation" means matching the criteria, not every message that happens to sit in the same thread.
If the action was Delete it, open Trash and click Empty Trash now when you want the space back. Until then the messages still use storage. The search-and-delete version of this, without saving a filter, is in how to find large emails in Gmail.
Start from a message you already have
Google's steps when one message is a good example of what you want to catch:
- Open Gmail on a computer.
- Check the box next to that email.
- Click More.
- Click Filter messages like these.
- Gmail fills in criteria from that message. Change them if the sender alone is too broad.
- Click Create filter, choose the actions, and click Create filter again.
Edit, delete, export
- Open Gmail on a computer.
- At the top right, click Settings, then See all settings.
- Click Filters and Blocked Addresses.
- Find the filter. Click Edit or Delete.
- After an edit, click Continue, then Update filter. After a delete, click OK.
Deleting a filter stops it from running on future mail. It does not peel labels off, move archived mail back to the inbox, or restore anything already sent to Trash.
To keep a copy, check the box next to the filter and use Export at the bottom of the page. Gmail downloads an XML file. Import filters on that same page reads the file back, which is also how you move the same rules to another Gmail account. On import, choose the file, click Open file, then Create filters.
If you rename or delete a label a filter applies, update the filter. It keeps pointing at the old label name.
Filters on the Gmail app
You cannot create or edit a filter in the Gmail app on Android or iPhone/iPad. Google's help says to open Gmail on a computer, including in the Android and iPhone articles about keeping a sender out of Spam. The app has Block on a message. Creating a filter, editing one, and the Filters and Blocked Addresses list are on the computer.
Google's steps do not include a phone-browser workaround. A filter created on a computer still applies to new mail in the app, because it runs on the account.
Where MailSweeper fits
A filter does what you told it, on the mail that matches. It does not decide which of last year's newsletters are safe to remove.
MailSweeper is that cleanup, on mail already in the account:
- Quick Clean moves matching mail to Trash, including messages with attachments over 10 MB, promotions older than a year, social notifications older than six months, and updates older than a year. On the category screen the age can be 6 months, 1 year, 2 years, 5 years, or 10 years.
- Unsubscribe on a sender adds that address to a Gmail filter that deletes future mail from them. When the message has an unsubscribe link, MailSweeper also shows the sender's own page. The filter does not sign you off the list by itself.
- The Dustpan label covers the categories you turn on (promotions, social, updates, and forums). It skips important, starred, sent, and draft mail. A schedule then moves Dustpan mail to Trash after 7, 14, 30, 90, or 180 days. Starred and important mail are skipped again at sweep time.
Deleted mail still sits in Gmail Trash for 30 days. Annual is $24/year, with a 14-day free trial if you have not subscribed before, or $99 once.
FAQs
Can I create a filter in the Gmail app?
No. Google's help says you have to open Gmail on a computer. The Android and iPhone apps can block one sender from a message. They cannot create, edit, or delete filters. A filter you create on a computer still runs on new mail when you use the app.
How do I apply a Gmail filter to emails already in my account?
On the action screen, check Also apply filter to matching conversations, then click Create filter (or Update filter if you are editing). Gmail runs the actions once on conversations that already match. Click Search first and read the results, especially if the action is Delete it. The box is unchecked the next time you edit the filter. New mail does not depend on it. Forwarding still applies only to new messages.
Why did a reply skip my filter?
Google's help says a reply is filtered only when the reply meets the same search criteria. A filter on a subject line misses the reply when the subject changed, which is common once the thread picks up "Re:". Match From, or a word that is still in the reply, if the reply should be included.
Does deleting a filter undo it?
It stops future mail from being filtered. Labels, archive, and Trash from earlier runs stay as they are. Put archived mail back from All Mail, or restore Trash, yourself. Export the filter first if you might want the same rule again.
What is the difference between a filter and Block?
Block is one address, from the message menu, and later mail from that address goes to Spam. A filter can match a domain, a subject, a size, or a word, and its actions include archive, label, star, forward, and delete. Delete means Trash. A filter cannot mark mail as spam. Never send it to Spam keeps a sender out of Spam, and it does not override a block. Unblock the address first.
