Gmail filters automatically sort incoming mail into folders, delete spam, or flag messages based on rules you create
A Gmail filter is a set of instructions that tells Gmail what to do with messages that match certain criteria. You can filter by sender, subject line, words in the message body, file attachments, or size. Once you create a filter, Gmail applies it automatically to all new incoming mail — and optionally to messages already in your inbox.
Filters save time by moving newsletters to a specific folder, automatically marking work emails as important, or sending certain senders straight to trash. You can create as many filters as you need, and they work across Gmail on the web, phone, and tablet.
Key Takeaways
- Filters are created through Gmail's search and settings, and you define what Gmail should do with messages that match your criteria.
- You can filter by sender address, subject line, keywords, attachments, or message size, and combine multiple criteria in a single filter.
- Common filter actions include moving mail to a label, skipping the inbox, marking as read, or deleting automatically.
- Filters apply to new mail by default, but you can choose to apply a filter to existing messages when you create it.
Create a filter using Gmail search
The fastest way to create a filter is to start with a message you want to filter. Open the email, click the three-dot menu icon in the top right, and select "Filter messages like this." Gmail opens a filter preview showing what criteria it detected — usually the sender's address.
From there, you can add more criteria or remove what Gmail suggested. Click "Create filter" at the bottom right, choose what you want Gmail to do with matching messages, and click "Create filter" again. The filter is now active.
If you do not have a specific message to start from, go to Gmail Settings (the gear icon in the top right, then "See all settings"), click the "Filters and Blocked Addresses" tab, and click "Create a new filter" at the bottom of the page. This opens the same filter creation form.
Set filter criteria to match the messages you want
When you create a filter, Gmail shows fields for From, To, Subject, Has the words, Does not have, Has attachment, and Size. You only need to fill in the fields that matter for your filter.
The From field filters by sender email address — type a full address or part of one. The Subject field matches words in the subject line. Has the words searches the entire message body and subject. Does not have excludes messages containing certain words, useful for filtering out false positives. Has attachment is a checkbox that matches only messages with files. Size lets you filter by message size in bytes.
Combine multiple criteria to narrow your filter. For example, filter messages from your manager with "urgent" in the subject, or messages from a mailing list that do not contain your name. Gmail shows a preview of how many messages match your criteria as you type.
Choose what Gmail does with filtered messages
After you set your criteria and click "Create filter," Gmail shows a list of actions. Check the boxes for the actions you want:
- Skip the Inbox — the message goes straight to the archive, out of your inbox view but still searchable.
- Mark as read — Gmail marks the message as read automatically so it does not show as new.
- Star it — adds a star icon to the message for quick visibility.
- Apply label — moves the message to a folder (label) you choose or create. This is the most common action.
- Forward it to — sends a copy to another email address.
- Delete it — sends the message to Trash automatically.
- Never send it to Spam — prevents Gmail from marking messages from this sender as spam.
- Always mark it as important — flags the message as important in Gmail's priority inbox.
- Mute it — hides the message and future replies from your inbox and notifications.
You can select multiple actions. For example, you might apply a label and skip the inbox, so the message is organized but does not clutter your main view. Click "Create filter" when you are done.
Apply filters to messages already in your inbox
By default, filters only affect new incoming mail. If you want to apply a filter to messages you already received, check the box "Also apply filter to matching conversations" before you click "Create filter." Gmail then searches your entire inbox and applies the filter to all matching messages.
This is useful when you create a filter for an old mailing list or sender you have been receiving for months. Without this option, only future messages from that sender would be filtered, leaving old messages behind.
Edit or delete a filter
To change a filter you created, go to Gmail Settings, click "Filters and Blocked Addresses," and find the filter in the list. Click the edit icon (pencil) to modify the criteria or actions, or click the delete icon (trash) to remove it entirely.
If a filter is not working as expected, check that your criteria are specific enough. A filter for "From: john" matches any sender with "john" in their address, which might be too broad. Use the full email address or a more specific part of the name to narrow it down. You can also test a filter by searching Gmail for the same criteria to see what messages it would match.
Common filter setups that save time
Many people use filters for newsletters and marketing mail. Create a filter for messages with "unsubscribe" in the body (a legal requirement for marketing email), apply a label like "Marketing," and skip the inbox. This keeps promotional mail organized without cluttering your main view.
Work filters are another common use. Filter messages from your manager or team by sender address, apply a label like "Work," and optionally mark them as important. This separates work from personal mail and makes it easy to find work messages later.
You can also filter by domain. To filter all mail from a company, use "From: @companyname.com" in the From field. This catches messages from anyone at that company without listing each address individually.
Frequently Asked Questions
Can I create a filter that applies to multiple senders at once?
Not in a single filter. Create one filter per sender or use a domain filter (From: @domain.com) to catch all messages from a company. If you need to filter many unrelated senders, create multiple filters with the same action — Gmail applies all matching filters to each message.
What happens if two filters apply to the same message?
Gmail applies all matching filters in the order you created them. If one filter labels a message and another deletes it, the message is deleted. If both filters apply labels, the message gets both labels. Test filters on a few messages first if you are unsure how they will interact.
Can I undo a filter that was applied to old messages?
Deleting the filter does not undo its past actions. If a filter moved old messages to a label and you delete the filter, those messages stay in the label. You would need to manually move them back or search for them and move them yourself. Create filters carefully before applying them to existing mail.
Do filters work on Gmail's mobile app?
Filters are created and managed on Gmail's website only, but they apply to mail on your phone and tablet automatically. You cannot create or edit filters in the Gmail app — you must use a web browser and go to Gmail Settings.
Can I filter messages by how large they are?
Yes. In the Size field, enter a number followed by M for megabytes or K for kilobytes. For example, "5M" filters messages larger than 5 megabytes. This is useful for finding and deleting old messages with large attachments to free up storage.