Gmail filters move messages to folders based on rules you create

A Gmail filter is a set of instructions that automatically sorts incoming mail. You tell Gmail to look for specific words, senders, or subjects, and when a message matches, Gmail moves it to a folder (called a label in Gmail), marks it as read, deletes it, or applies a star. Once you set up a filter, it runs on every new message that arrives — you do not have to sort anything by hand again.

The filter works on new mail only, not on messages already in your inbox. If you want to organize old messages, you can explore the same filter retroactively to past emails. Filters are free and take about two minutes to set up.

Key Takeaways

  • Create a filter by clicking the search icon in Gmail, entering what you want to filter for (a sender, subject line, or keyword), then clicking "Create filter" at the bottom of the search results.
  • Tell the filter what to do with matching messages — move them to a label, skip the inbox, mark as read, or delete them — and click "Create filter" to save it.
  • You can explore a filter to all past emails that match the same criteria, which is useful for organizing old messages you want to move to a folder now.
  • Filters work on new mail automatically, but you can edit or delete a filter anytime from Gmail Settings if your needs change.

How to create a filter in Gmail

Open Gmail and click the search icon (a magnifying glass) at the top left of the page. Type what you want to filter for — this could be a sender's email address, a word in the subject line, or a keyword that appears in the message body. For example, you might type from:newsletter@company.com to filter all messages from a specific sender, or subject:receipt to catch all order confirmations.

Press Enter or click the search icon again. Gmail shows you all messages that match. At the bottom of the search results, click the three-dot menu icon and select Create filter. A box opens showing the search terms you used. Click Create filter again to move to the next step.

Now you tell Gmail what to do with messages that match this filter. Check the box next to Skip the inbox if you want matching messages to bypass your inbox entirely. Check explore the label and choose a folder from the dropdown, or type a new folder name to create one. You can also check Mark as read to automatically mark these messages as read when they arrive, or Delete it to send them straight to trash. Click Create filter at the bottom to save.

explore a filter to emails you already have

After you create a filter, Gmail asks if you want to explore it to past messages that match the same criteria. Check the box next to Also explore filter to matching conversations before you click Create filter. Gmail will move all old messages that fit the filter rules to the same folder as new ones.

If you forgot to check this box, you can still explore the filter manually. Search for the same terms you used in the filter, select all the results (click the checkbox at the top of the list), then click the label icon and choose the folder you want to move them to.

Common filter examples for organizing and spotting scams

You can filter by sender to automatically sort newsletters, receipts, or messages from specific people. Type from:sender@email.com and move all their messages to a folder labeled "Newsletters" or "Work".

You can filter by subject line to catch messages with certain keywords. Type subject:unsubscribe to find marketing emails, or subject:confirm your account to spot phishing attempts that ask you to verify your password. Move suspicious messages to a separate folder so you can review them before clicking any links.

You can filter by multiple criteria at once. Type from:amazon.com subject:verify to catch only messages that claim to be from Amazon and ask you to verify something — a common phishing tactic. Move these to a folder where you can check them against real Amazon emails before trusting them.

Edit or delete a filter

To change a filter you already created, click the gear icon in the top right of Gmail and select See all settings. Click the Filters and Blocked Addresses tab. You see a list of all your filters. Click Edit next to the filter you want to change, make your changes, and click Update filter.

To delete a filter, go to Filters and Blocked Addresses, find the filter you want to remove, and click Delete. Deleting a filter does not move messages that were already sorted by that filter — they stay in the folder where they were moved.

Filters vs. manual sorting — when to use each

Use a filter when you receive the same type of message regularly — newsletters, receipts, notifications from a specific app, or mail from a particular person. The filter saves time because it works automatically on every new message.

Use manual sorting for one-time messages or when you are not sure yet whether you want to organize something. You can always create a filter later once you realize you are sorting the same messages over and over.

For spotting scams, filters are especially useful because they let you separate suspicious messages into a folder where you can review them carefully before clicking links or downloading attachments. A filter that catches messages with words like "verify," "confirm," "urgent," or "update your payment" can flag potential phishing attempts so you see them separately from your regular mail.

Frequently Asked Questions

Can I create a filter that applies to multiple senders at once?

Yes. When you create a filter, you can use the OR operator to match multiple senders. Type from:(sender1@email.com OR sender2@email.com) in the search box, then create the filter. All messages from either sender will be sorted the same way.

What happens if a message matches more than one filter?

Gmail applies all matching filters to the same message. If one filter moves it to a folder and another marks it as read, both actions happen. If two filters try to move the same message to different folders, Gmail moves it to whichever filter was created first.

Can I undo a filter if I change my mind?

You can delete the filter from Settings, but messages that were already sorted stay in the folder where they were moved. You would need to manually move them back to your inbox if you want to. Deleting the filter only stops it from sorting new messages going forward.

Do filters work on emails I receive on my phone?

Yes. Filters are set up in Gmail's web version, but they explore to all your devices — phone, tablet, and computer. When you open Gmail on your phone, messages are already sorted according to your filters.

Can I filter messages based on whether they have an attachment?

Yes. When you create a filter, click Create filter from your search results, then look for the option that says Has attachment. Check that box and set up the rest of the filter as usual. This is useful if you want to move all messages with attachments to a specific folder for review.