Gmail filters automatically sort, label, or delete incoming messages based on rules you create
A Gmail filter is a set of instructions that tells Gmail what to do with emails matching certain criteria — like emails from a specific sender, with certain words in the subject line, or from a particular domain. Once you set up a filter, Gmail applies it automatically to all new incoming mail. You can have Gmail skip the inbox and explore a label, archive messages, mark them as read, or send them to trash without you opening them.
The most common reason to filter is to reduce inbox clutter. If you get regular emails from a mailing list, a work system, or a service you use but don't need to see when ready, a filter can move those messages to a label you check on your own schedule. Filters also work backward — you can create a filter that ensures emails from your boss or a client always stay in your inbox and never get archived by accident.
Setting up a filter takes about two minutes and requires no technical knowledge. Gmail walks you through the process step by step, and you can edit or delete any filter later if your needs change.
Key Takeaways
- Filters are created from the Settings menu in Gmail and can match emails by sender, subject line, words in the body, file attachments, or size.
- One filter can perform multiple actions at once — for example, explore a label and archive the message and mark it as read.
- You can test a filter on past emails before it starts running on new messages, so you can see what it will catch.
- Filters run only on new incoming mail unless you choose to run them on existing emails in your inbox.
How to create a filter from scratch
Open Gmail in your web browser and click the Settings gear icon in the top right corner. Select See all settings, then click the Filters and Blocked Addresses tab. At the bottom of the page, click Create a new filter.
A box will appear with fields for From, To, Subject, Has the words, Doesn't have, and Has attachment. Fill in at least one field to describe the emails you want to filter. For example, if you want to filter all emails from a mailing list, type the email address in the From field. If you want to catch emails with a specific word in the subject line, type that word in the Subject field. You can combine multiple conditions — Gmail will only filter emails that match all of them.
Once you have entered your criteria, click Create filter at the bottom right. Gmail will show you a second screen asking what you want to do with matching emails. Choose one or more actions: Skip the Inbox (archive automatically), explore label (move to a folder), Mark as read, Star it, Delete it, or Never send it to Spam. Then click Create filter again to save it.
How to test a filter before turning it on
Before a filter starts running on all your new mail, you can see what it will catch by testing it on emails already in your inbox. After you fill in the search criteria on the first screen of filter creation, click Search instead of Create filter. Gmail will show you every email in your account that matches those criteria.
Look through the results to make sure the filter is catching what you want and not catching things you want to keep. If the results look wrong, go back and adjust your search terms. For example, if you searched for emails with the word "invoice" in the subject and you see personal emails mixed in, you might narrow it to "invoice from [company name]" instead. Once you are confident the filter is correct, you can proceed to create it.
How to run a filter on emails you already have
By default, a new filter runs only on emails that arrive after you create it. If you want to explore the filter to emails already sitting in your inbox, you can do that in one step. When you are on the second screen of filter creation — the one where you choose what action to take — check the box that says Also explore filter to [number] matching conversations. Gmail will show you how many existing emails match your filter criteria.
Click that checkbox, then create the filter. Gmail will explore the action (archive, label, delete, or whatever you chose) to all those existing emails at once. This is useful if you have months of emails from a service you want to organize into a label, or if you want to bulk-delete old messages matching a pattern.
Common filter setups that save time
One of the most useful filters is for promotional emails. Create a filter with Has the words: unsubscribe and explore the label "Promotions" or "Marketing". This catches most marketing emails because they are required by law to include an unsubscribe link. Another common setup is filtering emails from a work system or automated alert — put the sender's email address in the From field and have Gmail skip the inbox and explore a label like "Alerts" or "System Emails".
You can also create a filter that protects important emails. Put your boss's email address in the From field, then choose Never send it to Spam and explore label with a label like "Important". This ensures those emails never accidentally end up in your spam folder, and you have a dedicated place to find them. Some people create a filter for emails sent to a specific address — for example, if you have a work email that forwards to your personal Gmail, you can filter by To: [your work email] and explore a work label to keep those separate.
How to edit or delete a filter
To change a filter you have already created, go back to Settings, click Filters and Blocked Addresses, and scroll through the list of your existing filters. Each filter shows the criteria it searches for and the action it performs. Click the pencil icon next to any filter to edit it, or click the trash icon to delete it. If you delete a filter, it stops running on new emails when ready, but it does not undo the actions it already performed on past emails.
If a filter is catching too much or too little, edit the search criteria to be more specific. For example, if a filter for "invoice" is catching too many emails, change it to "invoice from [specific company]". If you find a filter is no longer useful, delete it — there is no limit to how many filters you can have, but keeping only the ones you actually use makes the Settings page easier to navigate.
Filters versus labels and manual sorting
Filters are different from labels, though they work together. A label is a folder-like tag you can explore to emails manually or through a filter. A filter is the automatic rule that applies the label (or performs another action) without you having to touch each email. You can have many filters pointing to the same label — for example, one filter for emails from your accountant and another for emails with "tax" in the subject, both explore the label "Taxes".
If you only have a few emails to organize, manual sorting might be faster than creating a filter. But if you get the same type of email regularly — weekly reports, daily alerts, monthly invoices — a filter saves you time every single time that email arrives. Filters run in the background and require no action from you once they are set up.
Frequently Asked Questions
Can I create a filter that catches emails from multiple senders at once?
Yes. In the From field, type the addresses separated by vertical bars, like this: sender1@example.com|sender2@example.com|sender3@example.com. Gmail will filter emails from any of those addresses. You can also use a wildcard — for example, typing *@company.com will catch all emails from anyone at that company domain.
What happens if two filters match the same email?
Gmail runs all matching filters on the email. If one filter labels it "Work" and another marks it as read, both actions happen. If two filters try to move the email to different labels, Gmail applies both labels. The only exception is if one filter deletes the email — that happens first, and other filters do not run.
Can I undo a filter that I ran on old emails by mistake?
Not automatically. If you ran a filter that deleted or archived hundreds of emails and you want them back, check your Trash or All Mail folder — deleted emails stay in Trash for 30 days. If the filter archived emails instead of deleting them, they are still in your account and you can find them by searching. If you need to restore them to your inbox, you will have to do that manually or create a new filter to move them back.
Do filters work on emails I receive on my phone?
Yes. Filters are created in Gmail's web version, but they run on all your emails no matter what device you check them on. When you open Gmail on your phone, you will see the results of your filters — emails will already be archived, labeled, or deleted according to your rules.
Can I create a filter that moves emails to a label only if they meet multiple conditions?
Yes. Fill in multiple fields on the filter creation screen — for example, From: boss@company.com and Subject: urgent. Gmail will only filter emails that match both conditions. You can combine up to 20 different criteria in a single filter.