Gmail filters do the sorting for you automatically
A Gmail filter is a rule you set once that automatically sorts incoming emails into folders, marks them as read, or deletes them based on what you tell it to look for. You do not have to sort messages by hand every time they arrive. Instead, you write a filter that says "if an email comes from my bank, send it to the Banking folder" or "if an email has 'receipt' in the subject line, mark it as read automatically." Gmail checks every new message against your filters and acts on the ones that match.
The filter setup takes about two minutes per rule. You can create as many filters as you need, and they work on emails that arrive after you set them up. Filters do not go back and reorganize old messages unless you tell Gmail to apply the filter to existing mail.
Key Takeaways
- You create filters in Gmail Settings under the Filters and Blocked Addresses tab, where you choose what to search for and what action Gmail should take.
- The most common filter action is to add a label (Gmail's version of a folder), which groups related emails together in one place.
- You can filter by sender, subject line, words in the message body, file attachments, or any combination of these.
- After you create a filter, you can choose to apply it to all existing emails that match, or only to new messages going forward.
How to create your first filter in Gmail
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 near the top of the page.
Click Create a new filter at the bottom of the list. A box will open with fields for From, To, Subject, Has the words, Does not have, Size, Date within, and Attachments. Fill in at least one field with what you want Gmail to search for. For example, type your bank's email address in the From field if you want to filter all emails from that sender. Click Create filter when you are done entering your search terms.
Gmail will now show you a second screen asking what to do with emails that match. Check the box next to Apply the label and choose a label from the dropdown menu, or type a new label name to create one. You can also check other boxes to skip the inbox, mark as read, or delete automatically. Most people start by just adding a label so they can see what gets caught by the filter. Click Create filter to save it.
Using the search box to build a filter quickly
If you already have an email you want to filter, you can use it as a template. Open the email and click the three-dot menu icon on the right side of the message. Select Filter messages like this. Gmail will open the filter creation screen with the sender, subject, and other details already filled in based on that email.
Review what Gmail found and remove any fields you do not want to filter on. For instance, if you only want to filter by sender and not by subject line, delete the text in the Subject field. Then proceed to choose your label and other actions as described above. This method is faster than typing everything by hand, especially if you are filtering emails with long or complicated subject lines.
Filter examples for common email situations
Here are filters that solve problems most people run into:
- Newsletters and marketing emails: In the From field, type the sender's address. Apply a label called "Newsletters" and check the box to skip the inbox so they do not clutter your main view.
- Receipts and confirmations: In the Has the words field, type "receipt order confirmation invoice". Gmail will catch emails with any of those words. Apply a label called "Receipts" so you can find them when you need proof of purchase.
- Work emails from one person or team: In the From field, type the email address or domain. If you want all emails from anyone at your company, type @yourcompany.com. Apply a "Work" label.
- Emails with attachments: Check the Attachments box and select "Has attachment". Apply a label called "Files" so you know which messages have something you downloaded.
- Emails you want to see but not in your inbox: Create a filter for the sender or subject, apply a label, and check "Skip the inbox" so the message goes straight to that label's folder.
What to do if a filter is catching too much or too little
If your filter is sorting emails you do not want sorted, go back to Settings, click Filters and Blocked Addresses, find the filter in the list, and click the edit icon (pencil). You can make the search more specific by adding more fields. For example, if your "Receipts" filter is catching emails about receipt of a package when you only want purchase receipts, change "Has the words" to "purchase receipt" instead of just "receipt".
If your filter is missing emails it should catch, the problem is usually that the search term does not match exactly what is in the email. Open one of the emails that should have been filtered, look at the exact wording in the From line or subject line, and update your filter to match. You can also check the box to apply the filter to existing emails so it catches messages that arrived before you fixed it.
To delete a filter you no longer need, go to Filters and Blocked Addresses, find it in the list, and click the delete icon (trash can). Deleting a filter does not affect emails that were already sorted by it — they stay in their labels.
Labels versus folders and how filters use them
Gmail does not have traditional folders like Outlook or other email programs. Instead, it uses labels, which are tags you can attach to emails. One email can have multiple labels at the same time, so a message from your boss about a work project could have both a "Work" label and a "Projects" label. When you click on a label in the left sidebar, you see all emails with that label.
When you create a filter and apply a label, Gmail adds that label to matching emails. If you also check "Skip the inbox," the email will not show up in your main inbox view, but it will still appear when you click the label. This is how filters create the effect of sorting into folders — the emails are still in Gmail's system, just organized by label so you can find them easily.
Frequently Asked Questions
Can I filter emails that are already in my inbox?
Yes. After you create a filter, Gmail asks if you want to apply it to existing emails. Check that box and Gmail will sort all past messages that match the filter. This is useful if you are organizing old emails for the first time.
What happens if two filters match the same email?
Gmail applies both filters. If one filter adds a "Work" label and another adds a "Urgent" label, the email will have both labels. If one filter skips the inbox and another does not, the email will be skipped. Gmail processes filters in the order you created them.
Can I filter emails to delete them automatically?
Yes, but be careful. When you create a filter, you can check the box to delete matching emails automatically. Gmail will move them to Trash, where they stay for 30 days before being permanently deleted. Start with a label instead so you can review what the filter catches before you delete anything.
How do I filter emails by date or size?
In the filter creation screen, use the Date within field to catch emails from a specific time period, and the Size field to catch large emails. These are less common than filtering by sender or subject, but useful if you want to clean up old messages or find emails with big attachments.
Can I undo a filter if it sorts the wrong emails?
You can edit or delete the filter itself, but emails that were already sorted will keep their labels. To remove a label from emails, open the label, select the emails you want to change, and click the label icon to remove it. Or edit the filter to be more specific so it stops catching the wrong messages going forward.