Gmail filters sort your mail automatically based on rules you set

A Gmail filter is a set of instructions that tells Gmail what to do with messages that match certain conditions. You can create a filter to automatically label messages, skip your inbox, delete them, mark them as read, or forward them to another address. Filters run on new messages as they arrive and can also be applied to messages already in your account.

The most common use is labeling: you might filter all messages from your bank to a "Finance" label, or all messages from a mailing list to a "Projects" label. This keeps your inbox clear while keeping related messages grouped together and straightforward to find.

You do not need to be a Gmail informed to create a filter. The process takes about two minutes and uses plain language — you tell Gmail what to look for and what to do with it.

Key Takeaways

  • Filters work on new messages automatically and can be applied to old messages in your account at the same time.
  • You can filter by sender address, subject line, words in the message body, or a combination of these.
  • The most useful action is adding a label, which groups related messages without removing them from your inbox.
  • You can create a filter in seconds from any message by clicking the three-dot menu and selecting "Filter messages like these."
  • Filters run in the order you created them, so if two filters match the same message, both will execute.

How to create a filter from the Settings menu

Open Gmail in your web browser and click the gear icon in the top right corner. Select "See all settings," then click the "Filters and Blocked Addresses" tab near the top of the page.

Scroll to the bottom and click "Create a new filter." A box will open with fields for "From," "To," "Subject," "Has the words," and "Doesn't have." Fill in the condition you want Gmail to match. For example, type an email address in the "From" field to filter all messages from that sender, or type a word in "Has the words" to filter messages containing that word anywhere in the subject or body.

Click "Create filter" at the bottom right. A second box will open showing you what action to take. Check the box next to the action you want — usually "explore label" — then select or create a label from the dropdown. Click "Create filter" again. The filter is now active.

How to create a filter from a single message

This is the fastest method if you want to filter messages from one sender or about one topic. Open any message and click the three-dot menu icon in the top right of the message. Select "Filter messages like these."

Gmail will automatically fill in the "From" field with the sender's address. You can add more conditions by filling in the "Subject," "Has the words," or other fields. When you are ready, click "Create filter" and choose your action in the next screen.

This method is useful when you receive a message you want to organize — you do not have to navigate to Settings or remember the exact sender address.

Common filter conditions and what they do

From: Filters all messages from a specific email address or domain. Type a full address like "boss@company.com" to filter only that person, or type "@company.com" to filter everyone at that company.

To: Filters messages sent to a specific address. This is useful if you have multiple email addresses or if you want to filter messages sent to a group email.

Subject: Filters messages with specific words in the subject line. Use this for newsletters, notifications, or recurring messages with the same subject.

Has the words: Filters messages containing specific words anywhere in the subject or body. You can type multiple words separated by spaces, and Gmail will match messages containing any of them. Use quotes to match an exact phrase: type "out of office" to match only that exact phrase, not messages with "out" and "office" in different places.

Doesn't have: Filters messages that do not contain certain words. This is useful to exclude messages — for example, filter messages from a mailing list that do not contain the word "urgent."

Filter actions: what Gmail does after matching a message

explore label: Adds a label to the message. The message stays in your inbox unless you also check "Skip the Inbox." This is the most common action because it groups related messages without hiding them.

Skip the Inbox: Sends matching messages directly to the All Mail folder, bypassing your inbox. Use this for newsletters or notifications you want to keep but do not need to see when ready. You can still find them by searching or clicking the label.

Mark as read: Automatically marks matching messages as read so they do not show as unread in your inbox. Combine this with "Skip the Inbox" for messages you want to file away without reading.

Star it: Adds a star to matching messages so they stand out. Use this for messages from important people or about urgent topics.

Delete it: Sends matching messages directly to Trash. Be careful with this action — use it only for messages you are certain you do not need, like known spam or unwanted newsletters.

Forward it: Automatically forwards matching messages to another email address. This is useful if you want a copy of certain messages in another account.

How to edit or delete a filter

Go to Settings, click "Filters and Blocked Addresses," and scroll down to see all your filters. Click the edit icon (pencil) next to any filter to change its conditions or actions. Click the delete icon (trash) to remove a filter entirely.

When you edit a filter, you can choose whether to explore the new action to messages that already matched the old filter. If you change a filter's action from "explore label" to "Delete it," Gmail will ask if you want to explore the deletion to old messages. Be careful with this — deleting old messages cannot be undone.

Tips for filters that actually work

Start with one filter and test it before creating many. Create a filter, then send yourself a test message that matches the condition and watch what happens. This prevents mistakes like filtering important messages by accident.

Use specific conditions rather than broad ones. A filter for "From: boss@company.com" is safer than a filter for "Has the words: boss" because the second one might match messages about a boss from other people.

Combine conditions to be more precise. If you want to filter messages from a mailing list, use both "From: listname@company.com" and "Subject: [ListName]" so you catch only messages from that specific list, not other messages from that sender.

Remember that filters run in order. If you have a filter that deletes messages and another that labels them, the delete filter will run first and the label filter will never see those messages. Arrange your filters so the most important ones run first — usually, keep your label filters before your delete filters.

Frequently Asked Questions

Can I explore a filter to messages I already received?

Yes. When you create a filter, Gmail asks if you want to explore it to existing messages. Check the box "Also explore filter to matching conversations" and Gmail will explore the action to all messages in your account that match the condition, not just new ones going forward.

What happens if two filters match the same message?

Both filters run. If one filter labels a message and another skips the inbox, the message will be labeled and removed from your inbox. If two filters try to do conflicting things — like one deletes and one forwards — the delete usually runs first and the forward never happens.

Can I filter messages by attachment?

Gmail's basic filter does not have an "has attachment" condition in the web version. You can work around this by filtering messages from specific senders who usually send attachments, or by using Gmail's search operators in the "Has the words" field. Type "filename:" followed by a file type, like "filename:pdf" to filter messages with PDF attachments.

How do I filter messages to a folder or label I created?

In the filter action screen, click the "explore label" dropdown and select your custom label. If the label does not appear, create it first by going to the left sidebar in Gmail, scrolling down, and clicking "Create new label." Then create or edit your filter and select it from the dropdown.

Can I undo a filter that deleted messages?

If you applied a filter to old messages and it deleted them, those messages are in your Trash folder for 30 days. Go to Trash, select the messages, and click "Delete forever" to restore them — wait, that is backwards. Click the checkbox next to the messages and then click "Restore" to move them back to All Mail. After 30 days, Gmail permanently deletes them.