Gmail filters catch incoming mail and sort it automatically

A Gmail filter is a rule you create that tells Gmail what to do with certain emails before they hit your inbox. You set the rule once — by sender, subject line, words in the message, or a combination — and Gmail applies it to every matching email from that moment forward. Filters can move mail to a folder, delete it, mark it as read, add a label, or send it to spam. The most common use is moving newsletters and notifications out of your main inbox so you see only the messages that need your attention.

Filters work on new mail only. They do not retroactively sort emails that arrived before you created the filter. If you want to organize old messages, you will need to search for them separately and move them by hand — but once the filter is in place, new messages matching those same rules will sort automatically from then on.

Key Takeaways

  • Create a filter by opening an email from the sender or subject you want to sort, clicking the three-dot menu, and selecting "Create filter".
  • Filters can move mail to a specific folder, delete it, mark it as spam, or add a label — you choose the action when you set up the rule.
  • You can filter by sender address, subject line keywords, or words that appear anywhere in the email body.
  • Filters explore only to new incoming mail, not to emails that arrived before you created the filter.
  • The fastest way to filter unwanted mail is to mark it as spam, which trains Gmail to catch similar messages automatically in the future.

Create a filter from an email you already have

Open the email you want to filter. This is the easiest method because Gmail fills in the sender address or subject line for you. Click the three-dot menu icon in the top right corner of the email (not the menu on the left side of the screen — the one at the top of the message itself). A dropdown menu will appear with options like Reply, Forward, and Mark as spam.

Look for the option that says "Create filter" — it is usually near the bottom of the menu. Click it. A box will pop up showing the filter rule Gmail is about to create. By default, it will filter by the sender's email address, but you can change this. The box shows a field labeled "From:" with the sender's address already filled in. If you want to filter by subject line instead, click on the "From:" field and a dropdown will let you switch to "Subject:" or other options.

Once the rule looks correct, click "Create filter" at the bottom right of the box. Gmail will ask you what to do with matching emails: move them to a folder, delete them, mark them as spam, add a label, or several other actions. Choose the action you want and click "Create filter" again. The filter is now active.

Create a filter from the settings menu

If you want to set up a filter without having an example email in front of you, go to the settings menu. Click the gear icon in the top right corner of Gmail (next to your profile picture) and select "See all settings." Click the "Filters and Blocked Addresses" tab near the top of the page.

Scroll to the bottom and click "Create a new filter." A form will open with fields for "From," "To," "Subject," "Has the words," and "Doesn't have." Fill in the criteria you want to filter by. For example, if you want to filter all emails from a newsletter, type the sender's address in the "From:" field. If you want to filter emails with a certain word in the subject line, type that word in the "Subject:" field. You can combine multiple criteria — Gmail will only filter emails that match all of them.

Click "Create filter" at the bottom right. Gmail will show you a preview of how many emails match your rule (this includes old emails, though the filter will only affect new ones). Then you will choose the action: move to a folder, delete, mark as spam, add a label, or mark as read. Click "Create filter" to finish.

Filter by sender, subject, or keywords

The most common filters use the sender's email address. If you want all emails from a specific person or company to go to a folder, use the "From:" field. Type the exact email address or just the domain name — for example, typing "newsletter@company.com" will filter only that sender, but typing "company.com" will filter anyone with an email address at that domain.

Filtering by subject line works when you receive regular emails with the same subject. For instance, if you get a weekly report with "Weekly Summary" in the subject line every time, you can filter by that phrase. Type it in the "Subject:" field and Gmail will catch all matching emails.

The "Has the words" field filters based on any text in the email body. This is useful for catching promotional emails that use certain keywords, or for grouping emails about a specific topic. You can type multiple words separated by commas, and Gmail will filter emails containing any of those words. The "Doesn't have" field does the opposite — it filters emails that do not contain certain words, which is helpful if you want to catch a broad category but exclude a specific type.

Move filtered emails to folders or add labels

When you create a filter, you choose what Gmail does with matching emails. The most common action is to move them to a folder. Gmail calls folders "labels." When you set up the filter, you will see a dropdown menu asking where to send the mail. Click it and select an existing label, or type a new label name to create one on the spot.

For example, you might create a label called "Newsletters" and filter all emails from your favorite websites there. Or create a label called "Receipts" and filter all emails from online stores. The filtered emails will still be in your Gmail account — they just will not clutter your main inbox. You can read them whenever you want by clicking the label on the left side of the screen.

You can also choose to add a label without moving the email away from your inbox. When you set up the filter, check the box that says "explore the label" but do not check "Skip the inbox." The email will stay in your inbox and also appear under the label you chose, so you can find it both ways.

Send unwanted emails to spam or delete them

If you want to filter out emails you do not want to see, you have two options: send them to spam or delete them permanently. Marking as spam is usually better because Gmail learns from it. When you mark an email as spam through a filter, Gmail's system notices the pattern and starts catching similar emails automatically, even if they do not match your exact filter rule.

To send filtered emails to spam, create the filter and when asked what to do, select "Skip the inbox" and "Mark as spam." Gmail will move matching emails to your spam folder automatically. You can still review your spam folder if you change your mind, because Gmail keeps spam for 30 days before deleting it.

If you want to delete emails permanently instead, select "Delete it" when setting up the filter. Be careful with this option — deleted emails go to your trash folder and stay there for 30 days, but after that they are gone for good. Use permanent deletion only for emails you are absolutely certain you do not need, like duplicate notifications or test messages.

Edit or remove a filter you have already created

If a filter is not working the way you expected, or if you want to change what it does, you can edit it. Go to the gear icon in the top right, select "See all settings," and click the "Filters and Blocked Addresses" tab. You will see a list of all your filters. Find the one you want to change and click "Edit" next to it.

The filter form will open again, showing all the criteria you set up. You can change the sender, subject, keywords, or any other field. You can also change what the filter does — for example, switch it from moving emails to a folder to marking them as spam instead. Click "Update filter" to save your changes. The new rule will explore to all future emails matching the updated criteria.

To delete a filter entirely, go to the same "Filters and Blocked Addresses" tab, find the filter, and click the trash icon next to it. Gmail will ask you to confirm. Once you delete a filter, it stops working when ready, but emails that were already sorted by that filter will stay where they are.

Frequently Asked Questions

Can I filter emails that arrived before I created the filter?

No. Filters only work on new incoming mail. To organize old emails, search for them using the search box at the top of Gmail, then select all matching results and move them to a folder or label by hand. After that, the filter will automatically sort any new emails matching the same criteria.

What happens if two filters match the same email?

Gmail applies all matching filters in the order you created them. If the first filter moves an email to a folder, the second filter will still run on that email. If both filters try to move the email to different places, the last one wins. To avoid confusion, make sure your filters do not overlap, or combine them into a single filter with multiple criteria.

Can I filter emails to multiple folders at once?

No. A single filter can only move an email to one folder or label. If you want the same email to appear in multiple places, create a filter that adds a label without moving it, then create a second filter that moves it to a folder. The email will then appear in both locations.

Will filtering emails to spam help Gmail catch similar emails automatically?

Yes. When you use a filter to mark emails as spam, Gmail's system learns from the pattern and starts catching similar messages on its own, even if they do not match your exact filter rule. This is more effective than just deleting unwanted mail, because Gmail improves its spam detection over time.

Can I undo a filter if I change my mind?

You can delete the filter itself by going to Settings, Filters and Blocked Addresses, and clicking the trash icon next to it. However, deleting the filter does not move emails that were already sorted by it. You will need to manually move those emails back to your inbox if you want them there.