Gmail filters guide

Gmail filters, from first rule to advanced routing.

Create reliable Gmail filters for known patterns, test the search before activation, and use KeepKnown when the rule needs contacts, nested logic, safe previews, or a decision log.

CriteriaActionsTest firstAdvanced routing

Last updated

Diagram showing Gmail filter criteria flowing through a tested rule to label, archive, and review actions

Gmail filters are saved searches with automatic actions. A rule can match a sender, recipient, subject, phrase, attachment, size, or date and then archive, label, star, forward, delete, or categorize the matching message. Google documents the native workflow in its Gmail filter guide.

The safest workflow is search first, inspect the matches, and activate only when the result set is correct. KeepKnown extends that model with contact membership, nested conditions, previews against real mail, staged activation, and an explanation for every match.

Short answer

Use Gmail filters for predictable patterns.

Use sender, subject, keyword, date, attachment, and category rules when the pattern is already known. Use KeepKnown when a rule depends on relationships, multiple condition groups, or a safe preview.

The filter Gmail can't build

Want Gmail to only show mail from people you know?

Gmail filters can't test whether a sender is in your contacts. KeepKnown adds that rule: contacts and approved domains stay in the inbox, and everyone else moves to KK:OUTSIDERS. Nothing is deleted.

The audit is free and changes nothing in your inbox.

What a Gmail filter can match and do

StageExamplesWhy it matters
CriteriaFrom, To, Subject, words, size, date, attachmentDefines which messages qualify
TestRun the search before savingFinds false positives before automation
ActionsLabel, archive, star, categorize, forward, deleteControls what happens after a match
Existing mailApply to matching conversationsExtends the rule to the current backlog
ManagementEdit, delete, export, or import filtersKeeps the rule set maintainable

Free tool

Build the filter instead of typing it

The free filter creator turns From, Subject and keyword fields into a Gmail search you can test, a mailFilters.xml file you can import, and the same rule for Outlook. It runs in your browser and nothing you type is sent anywhere.

Open the free filter creator

Choose the right filtering layer

Native Gmail filters

Best for receipts, newsletters, alerts, exact senders, and other patterns that can be expressed as one search.

Contact-based screening

Use a sender's relationship to you when an exact address or keyword list would be impossible to maintain.

Advanced filter building

Combine conditions, preview real matches, save paused, and keep a decision log before enforcing a richer rule.

Native Gmail filters and KeepKnown

CapabilityNative GmailKeepKnown
Exact sender or keywordYesYes
Apply labels or move mailYesYes
Sender is not in contactsNo native conditionYes
Nested AND/OR groupsLimited search expressionUp to 3 levels
Preview on real mailSearch manuallyBuilt-in preview
Save without enforcingNo staged modePaused by default
Explain each decisionInspect the rule manuallyDecision log

Questions before you connect.

How do I create a filter in Gmail?

Open Gmail on a computer, select Show search options, enter and test the criteria, choose Create filter, select the actions, and save.

Can Gmail filters apply to existing emails?

Yes. Select the option to apply the filter to matching conversations when you create or update the rule.

Can Gmail filter everyone who is not in my contacts?

Gmail does not expose a native sender-not-in-contacts condition. KeepKnown adds contact-based screening without deleting the message.

Can I test a Gmail filter before creating it?

Run the criteria as a Gmail search first. KeepKnown also provides a dedicated preview and lets advanced filters remain paused.

Gmail filters

Build, preview, and activate a richer Gmail filter.