A Gmail filter is a saved rule that checks each incoming message against conditions such as sender, subject or words, and then applies actions such as adding a label, skipping the inbox, starring the message or marking it read. A label is a tag you attach to messages. Together they let Gmail sort mail the moment it arrives, so the inbox holds only what needs your attention.
The fastest way to build a filter is to search first, confirm the results, then choose Create filter from the search options. This guide explains labels, walks through creating filters, gives recipes you can adapt, and covers the mistakes that cause important mail to disappear.
Labels are not folders
In folder-based mail, a message lives in exactly one place. In Gmail, a message can have many labels at once, and a label is simply a searchable tag. Removing a label does not delete the message. Archiving removes the Inbox label only, so the message remains in All Mail and under any other label it carries.
Labels can be nested using the label dialog, which gives a folder-like tree in the sidebar, and each label can have a colour. Nesting is cosmetic. Searching label:clients includes messages in nested child labels, but a message in a child does not automatically carry the parent label in other views, so apply the label you plan to search on.
| Concept | Gmail behaviour |
|---|---|
| Move to folder | Apply label and archive |
| Copy to second folder | Apply a second label |
| Delete from folder | Remove the label; message stays in All Mail |
| Delete permanently | Move to Trash, then empty Trash or wait for automatic deletion |
| Folder tree | Nested labels |
Create a label
- In the left sidebar, scroll to the labels section and choose Create new label, or open Settings, See all settings, Labels.
- Name it. Choose a short, consistent scheme such as
Clients/Acmefor nesting. - Optionally pick a colour from the label menu in the sidebar.
- Decide whether the label shows in the label list and message list. Hiding labels you only use for filtering keeps the sidebar tidy.
Create a filter step by step
- Open the search box options at the right edge of the search field.
- Fill in the conditions: From, To, Subject, Has the words, Doesn't have, Size and Has attachment. You can also type search operators into the Has the words field. See Gmail search operators.
- Choose Create filter at the bottom. Gmail then shows the actions page.
- Tick the actions you want. Typical combinations are listed below.
- Tick Also apply filter to matching conversations if you want to clean up mail already in the mailbox.
- Select Create filter to save.
| Action | Effect | Use it for |
|---|---|---|
| Skip the Inbox (Archive it) | Removes the Inbox label, mail stays searchable | Newsletters and notifications you read later |
| Mark as read | Message arrives already marked as read | Low-value automated mail |
| Star it | Adds a star | VIP senders |
| Apply the label | Adds your chosen label | Everything sorted by topic |
| Forward it to | Sends a copy to a verified address | Routing to a team mailbox |
| Delete it | Moves to Trash | Mail you are certain you never need |
| Never send it to Spam | Overrides the spam classifier | Trusted senders caught by mistake |
| Always mark it as important | Sets the importance marker | Key contacts |
| Categorize as | Places in a tab such as Updates | Re-sorting tabs |
Filter recipes that work
| Goal | Conditions | Actions |
|---|---|---|
| Receipts and invoices | Has the words {receipt invoice "order confirmation"} | Apply label Receipts, skip the inbox |
| Newsletters | Has the words unsubscribe and From a known sender list | Apply label Newsletters, skip the inbox |
| Manager and VIPs | From [email protected] | Star it, always mark as important, never send to Spam |
| Server alerts | From [email protected] | Apply label Alerts, mark as read when low priority |
| Team list | To [email protected] | Apply label Team, skip the inbox |
| Aliases | Use deliveredto:[email protected] | Apply label Shopping |
The curly-brace syntax means any of the words. If you use a separate address for each service, plus addressing makes filters easy, see plus addressing and email aliases.
Use filters to protect important mail
Filters are more often used to hide mail than to protect it, but the protective use matters. If invoices, password resets or messages from your own application's mail system keep landing in Spam, a Never send it to Spam filter on the sender corrects it. Do this sparingly. For a sender that fails authentication, the right fix is on the sender's side, as explained in how to allow an email address.
Likewise, avoid filtering on a very broad condition such as the word account with a delete action. That sort of rule will eventually remove a security alert.
Manage, edit, export and import filters
- Open Settings, See all settings, Filters and Blocked Addresses to list every filter.
- Choose edit to change conditions or actions. Gmail saves a new version of the rule.
- Select filters and choose Export to download an XML file. Keep it as a backup before big changes.
- Choose Import filters to restore from a file or copy rules to another account.
- Review the list twice a year and remove rules for senders that no longer exist.
Menu names change with interface updates, so if you cannot find a setting, search the Gmail Help centre for the current path. Google also limits how many filters an account can hold, which most people never reach.
Labels and filters for shared inboxes and business mail
If several people triage the same mailbox, agree on a labelling scheme before building rules. A short list is easier to maintain: one label per customer or function, one for each status such as Waiting and Done, and one for automated notifications. For mailboxes that receive system mail, such as bounces from a sending service, a dedicated label plus skip-inbox keeps the signal available without noise. Detailed bounce handling belongs in your sending platform, see suppression list management.
A simple structure to start from
Many people over-engineer labels. A workable structure has three layers. First, a handful of topic or client labels that you search on. Second, a few status labels such as Follow-up and Waiting that you apply by hand. Third, one or two automation labels such as Notifications that filters apply and that you check on a schedule instead of continuously.
Keep the inbox for mail that needs a decision. Everything else should be labelled and archived on arrival. If you open the inbox and see more than a screen of items, one of your filters is too narrow or missing. Add the sender to an existing rule rather than creating another, because a long list of near-duplicate filters is hard to audit.
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| Filter does not run on old mail | Apply to matching conversations was not ticked | Edit the filter or run the search and apply the label manually |
| Filter does not run on new mail | Conditions too narrow, or the sender uses different addresses | Filter on the domain, for example from:@example.com |
| Message vanished | Skip the Inbox or Delete action | Search in:anywhere and check All Mail and Trash |
| Two filters conflict | Both match and apply different labels | Both apply; to avoid contradictory actions make conditions distinct |
| Forwarding action unavailable | Forward address not verified | Add and verify the address in Settings, Forwarding and POP/IMAP |
| Label count wrong | Labels count conversations, not messages | Open the label to see the conversations |
Next steps
Start small. Build three filters for the three noisiest senders, label them, skip the inbox and watch the result for a week. Then add rules for receipts and team mail. When your volume of automated mail grows beyond what filters can sort, consider whether those messages should arrive in a separate mailbox at all. If you send mail from applications, the guide to separating transactional and marketing streams shows how to keep the two apart at the source.
Sending mail from your own application? Route it through a relay that reports every delivery and bounce.
References and further reading
Frequently asked questions
What is the difference between a Gmail label and a folder?
A message can carry many labels at once, while a folder holds a message in only one place. Removing a label does not delete the message.
How do I create a Gmail filter?
Open the search options, enter conditions, choose Create filter, tick the actions you want and save.
Can I apply a filter to mail I already have?
Yes. Tick Also apply filter to matching conversations when you create or edit the filter.
Why did a message disappear after I made a filter?
A Skip the Inbox or Delete action probably matched it. Search in:anywhere to find it in All Mail or Trash.
Can I back up my filters?
Yes. In the Filters and Blocked Addresses settings you can export selected filters to an XML file and import them later.