Short answer: Gmail calls rules filters. On a computer, click Show search options in the search box, enter who or what to match, click Create filter, tick what Gmail should do (such as Apply the label, Skip the Inbox or Delete it) and click Create filter again. Google documents filters for Gmail on a computer, so set them up in a browser.
Filters are the most useful way to organize a Gmail inbox: newsletters skip the inbox into a label, receipts get filed, and messages from your boss get a star. Here's how to set them up, what they can do, and some rules worth copying. For more Gmail how-tos, see our complete guide to Gmail.
How to create rules in Gmail
- Open Gmail on a computer.
- In the search box at the top, click Show search options.
- Enter your criteria: a sender in From, an address in To, words in Subject, words the email has or doesn't have, a size, or attachments. Click Search first if you want to check which emails match.
- At the bottom of the search window, click Create filter.
- Choose what the filter should do.
- Click Create filter.
Next to the final button there's a checkbox to also apply the filter to matching conversations you already have. Tick it to clean up old mail in the same step; leave it unticked and the rule only affects new mail.
Create a rule from an email
Faster when you're looking at the email you want to sort: tick the box next to it in the inbox, click More (three dots), choose Filter messages like these, adjust the criteria and click Create filter.
What Gmail rules can do
Google lists these actions for filters: send email to a label, archive, delete, star or automatically forward it. Some of the options you'll see:
| Action | What it's good for |
|---|---|
| Apply the label | Sorting mail into a topic, client or project (Gmail's version of folders) |
| Skip the Inbox (Archive it) | Newsletters and notifications you read later, or never |
| Star it / mark as important | Mail from people you can't afford to miss |
| Forward it | Sending receipts to an accounting address; Gmail asks you to verify the address first |
| Delete it | Senders you can't unsubscribe from |
| Send template | An automatic reply to specific emails, once templates are turned on |
Forwarding filters only act on new messages. To move emails to a folder automatically, combine Apply the label with Skip the Inbox: the email goes straight to that label and never shows in your inbox.
Gmail rules worth setting up
- To send newsletters to a Reading label, put unsubscribe in Has the words, then tick Apply the label (Reading) and Skip the Inbox.
- To file receipts, put receipt OR invoice OR order in Has the words and apply a Receipts label.
- To never miss key people, put boss@company.com OR partner@example.com in From and tick Star it.
- To sort sign-ups, put a plus address such as yourname+shop@gmail.com in To and apply a Shopping label. Our Gmail generator guide explains plus addresses.
- To find space hogs, set Size to greater than 10 MB and apply a Large label, so you can clear them out later.
Search operators work in the Has the words box too, for example category:promotions or -label:clients to exclude a label. The full list is on Google's search operators page.
Edit, delete or back up your rules
- Click Settings, then See all settings.
- Open the Filters and Blocked Addresses tab.
- Click Edit or Delete next to a filter. When editing, click Continue, then Update filter.
On the same tab you can tick filters and click Export to save them as an .xml file, then use Import filters to load them into another Gmail account.
If a rule isn't working, search with the same criteria and see what comes up. Filters match what you typed exactly, and a reply in a filtered conversation is only filtered if it matches the criteria too. Keep rules few and simple, and check now and then that nothing important is being archived or deleted.
More ways to organize your Gmail inbox
Filters work best with a few other habits: unsubscribe from emails on Gmail you no longer read, mass delete old emails, and know where archived emails go. Our wider guide covers how to organize your email inbox in Gmail, Outlook and Apple Mail. If messages go missing, check your filters first: one that skips the inbox or deletes mail is a common cause of Gmail not receiving emails.
When rules aren't enough
Disclosure: we make Canary Mail. Rules need you to predict every sender in advance. AI sorting handles the mail you didn't plan for. Canary Mail is an email app for Mac, iPhone, iPad, Windows and Android that works with Gmail, Outlook, iCloud, Yahoo, Exchange and other IMAP accounts. The free plan covers unlimited accounts on 2 devices with AI inbox sorting, and tracker blocking is on by default. The Growth plan ($36 a year) adds AI writing and summaries, read receipts and send later. More than 2 million people use it, and Apple has featured it on the App Store and the Mac App Store.
If you're comparing apps, see our list of Gmail alternatives with AI and privacy.
Frequently asked questions
Can you set up rules in Gmail?
Yes. Gmail's rules are called filters. Create them on a computer from Show search options in the search box, or from an email with More, then Filter messages like these.
How do I automatically move emails to a folder in Gmail?
Gmail uses labels instead of folders. Create a filter, tick Apply the label and choose the label, and tick Skip the Inbox (Archive it) so the emails go only to that label.
How do I exclude labels in Gmail searches and filters?
Put a minus sign in front of the operator, for example -label:clients. You can also use has:nouserlabels to find emails with no label at all.
Can I create Gmail rules on my phone?
Google's filter instructions are for Gmail on a computer, even on its Android and iPhone help pages. If you only have a phone, open Gmail in your browser's desktop view to create one.
How do I apply a Gmail filter to existing emails?
When you create the filter, tick the checkbox to also apply it to matching conversations before clicking Create filter. For an existing filter, edit it and tick the same box.