Gmail filters turn a saved search into an automatic action. They are free, fast, and dependable when the matching rule describes an exact fact about a message.
The hard part is not clicking “Create filter.” It is writing a query that catches the right mail without quietly catching the wrong mail too.
How Gmail filters work
A filter has two parts:
- Criteria decide whether a message matches. Gmail supports sender, recipient, subject, words, exclusions, size, date, and attachment criteria.
- Actions decide what happens next. A matching message can receive a label, skip the inbox, be starred, forwarded, deleted, or marked as read.
Google’s filter documentation shows the current interface. You can start from the search-options icon in Gmail’s search bar or from Settings, then “Filters and Blocked Addresses.”
Useful Gmail filter examples
Test each line in Gmail search before saving it as a filter.
Goal Search query Suggested first action Label one vendor’s receiptsfrom:billing@example.com
Apply Receipts
Find invoice PDFs
subject:invoice has:attachment filename:pdf
Apply Invoices
Group a mailing list
list:newsletter.example.com
Apply Newsletters
Catch calendar notices
from:(calendar-notification@google.com)
Apply Calendar
Exclude a key contact
subject:report -from:boss@example.com
Apply a review label
Find large attachments
has:attachment larger:10M
Apply Large files
Replace the example addresses and labels with your own. Parentheses group alternatives. A minus sign excludes a term. Gmail documents more operators in its search refinement guide.
A safe setup checklist
1. Run the search first
Paste the proposed rule into Gmail search. Review several pages of results, not just the first five messages. Look for edge cases from real mail.
2. Start with a label
Apply a visible test label for several days. Do not archive or delete yet. The label creates a review queue and keeps mistakes in sight.
3. Include existing matches only when intended
Gmail can apply a new filter to matching conversations already in the mailbox. That is useful for a cleanup, but it can relabel years of mail. Check the result count before selecting that option.
4. Review false positives
Open the test label and ask two questions:
- What matched but should not have?
- What should have matched but did not?
Add an exclusion only when it describes a repeatable boundary. Do not pile on exclusions to rescue a category that really depends on meaning.
5. Add archiving last
Once the label has been accurate for a week, edit the filter and choose “Skip the Inbox” if those messages do not need immediate attention. Archive is safer than delete because the mail remains searchable.
Common mistakes
Filtering on a display name. Display names can change or be copied. A full sender address or domain is usually more predictable.
Using broad subject words. A filter for subject:invoice can catch a customer asking about an invoice as well as an automated bill. Pair terms with a sender, attachment, or exclusion.
Creating overlapping archive rules. Gmail applies all matching filters. A message can collect several labels and be archived by any one matching rule.
Treating intent as a keyword. “Needs my reply” is not a stable word pattern. Use a review label or a meaning-based sorter for that category.
When filters are not enough
Choose a native filter when you can describe the match as a fact: who sent it, where it was sent, what fixed phrase appears, or whether it contains a file.
Choose AI tagging when the decision depends on what the sender wants or what the message means. The Gmail filters vs. AI tagging guide maps those cases. For a combined setup, start with the Gmail automation guide.
Edit, export, or delete a filter
Open Settings > See all settings > Filters and Blocked Addresses. From there you can edit a filter’s criteria and actions or delete the rule. Gmail also lets you select filters and export them as an XML file, then import that file into another Gmail account. Review imported rules before enabling them because addresses, labels, and forwarding targets may not belong in the new mailbox.
For applications that manage rules on a user’s behalf, Google documents the create, list, get, and delete operations in the Gmail API filter guide. The API needs its own authorization scope and is not required for personal filters created in Gmail settings.
A starter rule set
For a new system, five rules are plenty:
- receipts from known billing addresses get
Receipts - newsletters with a list header get
Newsletters - automated product alerts get
Notifications - messages sent to a project alias get that project label
- important contacts get starred but stay in the inbox
Run that set for a week. Keep the rules that lead to a useful view. Delete the ones that merely decorate messages.