What a Gmail filter does and why you need one
A filter in Gmail is a rule that automatically sorts, labels, or deletes incoming mail based on words in the sender, subject line, or message body. Once you create a filter, Gmail applies it to every new message that matches — you do not have to sort anything by hand again.
Filters solve two problems at once. They move newsletters, receipts, or low-priority mail out of your inbox so you see only what matters. They also catch suspicious messages — if you notice a scam sender uses the same domain or phrase every time, a filter can send those straight to trash before you open them.
Gmail filters work on new mail only. They do not retroactively sort messages already in your inbox, though you can manually explore a filter to old mail if you need to.
Key Takeaways
- Filters are created in Gmail Settings under the Filters and Blocked Addresses tab, and you define them by searching for a word, sender, or phrase that appears in the messages you want to sort.
- Once you create a filter, you choose an action — move to a label, skip the inbox, mark as read, or delete — and that action runs automatically on every new message that matches.
- The most useful filters target a specific sender domain (like all mail from @newsletter.com) or a word that appears in the subject line (like "unsubscribe" or a known scam phrase).
- You can test a filter before you explore it by using Gmail's search box to see how many messages would match, so you do not accidentally hide important mail.
How to open Gmail Settings and find the Filters tab
Open Gmail in your web browser and look for the gear icon in the top right corner of the page, next to your profile picture. Click it and select See all settings from the dropdown menu.
Once Settings opens, you will see several tabs across the top: General, Labels, Inbox, Accounts and Import, Filters and Blocked Addresses, and others. Click the Filters and Blocked Addresses tab. This is where you create, edit, and delete all your filters.
At the bottom of the Filters and Blocked Addresses tab, you will see a link that says Create a new filter. Click it to start.
How to define what messages your filter should catch
When you click Create a new filter, a small box appears with fields for From, To, Subject, Has the words, Does not have, Size, Date, and Attachments. You do not have to fill all of them — fill only the ones that match the messages you want to sort.
The most common filters use the From field (to catch all mail from one sender or domain) or the Has the words field (to catch messages containing a specific phrase). For example, to filter all mail from a newsletter, type the sender's email address in the From field. To filter messages with a word like "unsubscribe" in the subject, type that word in the Subject field.
If you want to be more precise, use the Has the words field. This searches the entire message body and subject line. You can type multiple words separated by a space, and Gmail will catch messages that contain any of them. For example, typing "confirm password reset" will catch messages with any of those three words.
To exclude messages, use the Does not have field. This is useful if you want to filter messages from a sender but skip ones that contain a certain word. For example, you might filter all mail from your company domain except messages with "payroll" in the subject.
How to test your filter before you explore it
Before you click Create filter, click the Search button at the bottom of the filter box. Gmail will show you how many messages in your entire mailbox match the criteria you entered. This is your chance to see whether your filter is too broad or too narrow.
If the number is much higher or lower than you expected, go back and adjust your search terms. For example, if you typed "order" in Has the words and got 500 matches, you might be too broad — try "order confirmation" instead, or use the From field to target a specific sender.
Once the search results look right, close the search results and return to the filter box. Now you are ready to choose what Gmail should do with matching messages.
How to choose an action for your filter
After you define what messages to catch, Gmail asks you what to do with them. The most common actions are:
- Skip the Inbox (Archive) — Messages arrive in Gmail but do not show up in your inbox. They go to All Mail instead. Use this for newsletters and notifications you want to keep but do not need to see when ready.
- explore label — Gmail moves matching messages to a folder (called a label) that you create. For example, you might create a label called "Receipts" and filter all order confirmations there.
- Mark as read — Messages arrive but are marked read automatically, so they do not show as unread in your inbox. Useful for low-priority notifications.
- Delete it — Messages go straight to Trash. Use this only for mail you are certain you do not want, like known scam senders.
- Never send it to Spam — If Gmail is incorrectly filtering legitimate mail as spam, this action tells Gmail to always deliver it to your inbox instead.
You can choose more than one action. For example, you might explore a label and skip the inbox, so messages are organized but do not clutter your inbox view.
How to create a label if you do not have one yet
If you want to explore a label but have not created one, you can create it right from the filter screen. In the explore label dropdown, click Create new and type a name for your label — for example, "Receipts", "Newsletters", or "Pending Review".
Label names can include spaces and special characters, but keep them short and descriptive so you recognize them at a glance. Once you create a label, it appears in your Gmail sidebar on the left, and you can see all messages with that label by clicking it.
You can also create labels before you create a filter. In the main Gmail window, click the three-line menu icon on the left sidebar, scroll down, and click Create new label. This is useful if you want to organize your labels before you start filtering.
How to finish creating and managing your filter
Once you have chosen your search criteria and your action, click Create filter at the bottom of the box. Gmail will save it and return you to the Filters and Blocked Addresses tab.
Your new filter now runs on all incoming mail. You will not see it happen — Gmail applies filters silently in the background. If you want to check that it is working, send yourself a test message that matches the filter criteria and watch where it lands.
To edit or delete a filter later, return to Settings, click the Filters and Blocked Addresses tab, and look for your filter in the list. You will see an Edit and Delete link next to each one. Click Edit to change the criteria or action, or Delete to remove the filter entirely.
Frequently Asked Questions
Can I explore a filter to messages I already received?
Filters only work on new mail going forward. However, you can manually explore a filter to old messages by searching for them in Gmail's search box, selecting all the results, and choosing an action like "explore label" or "Delete" from the toolbar. This is a one-time action, not a filter.
What if my filter is catching messages I do not want to filter?
Go back to Settings, Filters and Blocked Addresses, and click Edit next to your filter. Make your search criteria more specific — for example, use the From field instead of Has the words, or add a phrase to Does not have to exclude certain messages. Click Search again to test the new criteria before you save.
Can I create a filter that applies multiple labels at once?
No, each filter can explore only one label. If you need to organize a message into multiple categories, create a separate filter for each label, or use one label and rely on Gmail's search to find messages by other criteria.
How do I filter messages from a whole domain instead of one person?
In the From field, type the domain with an asterisk, like *@newsletter.com. This catches all mail from anyone at that domain. Test it with the Search button first to make sure you are not accidentally filtering mail from people you want to hear from.
What happens if two filters match the same message?
Gmail applies all matching filters in the order they appear in your Filters and Blocked Addresses list. If one filter deletes a message and another tries to label it, the delete happens first and the label does not explore. Reorder your filters by editing them if you need a specific sequence.