How to Create Rules and Filters in Gmail (Complete Guide)

Learn how to create Gmail filters to auto-label, archive, forward, and organize emails. Covers all three methods, advanced operators, and filter limits.

How to Create Rules and Filters in Gmail (Complete Guide)

Gmail filters automatically sort, label, archive, forward, or delete incoming emails based on rules you define. They run on every incoming message 24/7, so once a filter is set up, matching emails are handled without any manual work.

Filters are one of the most powerful features in Gmail, but most people only scratch the surface. Support teams use them to auto-label customer emails by priority, route billing questions to finance, and keep newsletters out of the inbox. This guide covers every method for creating filters, the full list of criteria and actions, advanced operators, and the limits you should know before you hit them.

If your team has outgrown Gmail filters and needs assignment, collaboration, and tracking, see how a shared inbox handles what filters cannot.

Three Ways to Create a Gmail Filter

You can only create filters on desktop. The Gmail mobile app does not support filter creation, but filters you create on desktop apply to all incoming mail, including emails that arrive on your phone.

This is the most common method.

  1. Open Gmail on your computer
  2. Click the filter icon (slider bars) on the right side of the search bar
  3. Enter your criteria (from, subject, has the words, etc.)
  4. Click Search to preview which emails match (optional but recommended)
  5. Click Create filter
  6. Select one or more actions (label, archive, forward, etc.)
  7. Check Also apply filter to matching conversations if you want it to apply retroactively
  8. Click Create filter

Method 2: From an Existing Email

Use this when you want to filter all messages from a specific sender.

  1. Open the email you want to filter
  2. Click the three-dot menu (More) at the top
  3. Select Filter messages like these
  4. Gmail pre-fills the From field with the sender's address
  5. Adjust criteria if needed, then click Create filter
  6. Select actions and click Create filter

Method 3: From Settings

Use this to view, edit, or create filters alongside your existing ones.

  1. Click the gear icon (top right) and select See all settings
  2. Go to the Filters and Blocked Addresses tab
  3. Click Create a new filter at the bottom
  4. Enter criteria, click Create filter
  5. Select actions, click Create filter

Filter Criteria (What to Match)

Every filter starts with criteria that tell Gmail which emails to match.

Field What It Matches Example
From Sender email or domain [email protected] or *@acme.com
To Recipient address [email protected]
Subject Words in the subject line invoice
Has the words Words anywhere in the email urgent OR critical
Doesn't have Excludes emails with these words newsletter
Size Email size (greater/less than) Greater than 5 MB
Has attachment Emails with any attachment Checkbox
Don't include chats Excludes Google Chat messages Checkbox

How criteria combine: All fields within a single filter use AND logic. An email must match every field for the filter to trigger. For OR logic, use the OR operator (must be uppercase) within a single field, or create separate filters.

Wildcard support: Use *@domain.com in the From field to match any address at that domain. Note that wildcards do not match subdomains - *@example.com will not catch [email protected].

Filter Actions (What to Do)

When a filter matches, Gmail can perform one or more of these actions simultaneously.

Action What It Does
Skip the Inbox (Archive it) Email goes to the label or All Mail, bypassing the inbox
Mark as read Email arrives pre-read (no unread count)
Star it Applies a star to the message
Apply the label Assigns a Gmail label (one label per filter)
Forward it to Auto-forwards to a verified email address
Delete it Sends to Trash (deleted after 30 days)
Never send it to Spam Prevents Gmail from marking it as spam
Always mark it as important Adds the importance marker
Never mark it as important Prevents importance marking
Categorize as Assigns to Primary, Social, Updates, Forums, or Promotions

You can combine multiple actions in one filter. For example, apply a label AND skip the inbox AND mark as read.

Advanced: Using Search Operators in Filters

The Has the words field accepts Gmail search operators, which unlocks more powerful filters than the basic form allows.

Operator What It Does Example
OR Match either condition (must be uppercase) urgent OR critical
from: Match specific sender from:[email protected] OR from:[email protected]
list: Match mailing list headers list:[email protected]
filename: Match attachment type filename:pdf
is:unread Match unread messages is:unread
larger: Match by size larger:5M
newer_than: Messages newer than a period newer_than:7d

Combining operators: You can build complex filters by combining operators in the Has the words field. For example, from:[email protected] OR from:[email protected] filename:pdf matches PDF attachments from either Alice or Bob.

Limitation: You cannot nest compound conditions with OR across different fields. For example, you cannot create a single filter for "(from Alice AND subject invoice) OR (from Bob AND subject report)." You would need two separate filters.

Common Gmail Filter Recipes for Support Teams

Auto-label emails by priority

Filter emails containing urgency keywords and apply a visible label so they stand out in the inbox.

  • Has the words: urgent OR critical OR down OR broken OR ASAP
  • Action: Apply label "High Priority" + Star it

Route billing emails to finance

Forward billing-related emails to the right team while keeping a copy in your inbox.

Auto-label by client domain

Identify which client an email is from at a glance.

  • From: *@clientdomain.com
  • Action: Apply label "Client - Acme Corp"

Archive newsletters and notifications

Keep automated emails out of the inbox without deleting them.

  • From: *@newsletter.example.com
  • Action: Skip the Inbox + Apply label "Newsletters" + Mark as read

Prevent spam false positives

Whitelist known senders whose emails sometimes get flagged.

  • From: *@importantclient.com
  • Action: Never send it to Spam + Always mark it as important

Separate emails by alias

If you use multiple email aliases (support@, sales@, info@) or a distribution list in Gmail, label each stream differently.

Managing Existing Filters

Edit a filter

Go to Settings > Filters and Blocked Addresses, find the filter, and click Edit. You can change criteria or actions, then save.

Delete filters

Same path - click Delete instead. You can select multiple filters with checkboxes for bulk deletion.

Export and import filters

Gmail supports XML export and import of filters, which is useful for sharing filter setups across team members or backing up configurations.

  1. Go to Settings > Filters and Blocked Addresses
  2. Click Export at the bottom to download all filters as an XML file
  3. Use Import filters to upload an XML file on another account

Imported filters are added to the bottom of the existing filter list without replacing anything.

Gmail Filter Limits

Gmail imposes several limits that are worth knowing before you build out a large filter system.

Limit Value
Total filters per account 500-1,000 (varies by account type)
Forwarding addresses per account 99 registered, 20 usable in filters
Characters per filter criteria 900
Total characters across all filters 20,000
Labels per filter 1 (use multiple filters for multiple labels)

Other limits to know:

  • Forwarding requires verification. Each forwarding address must be verified via a confirmation email before it can be used in a filter.
  • Spam can override filters. Gmail's spam classifier sometimes intercepts emails before filters process them. The "Never send to Spam" action helps but is not 100% reliable.
  • Filters are forward-looking by default. They only apply to new incoming mail unless you check "Also apply filter to matching conversations" during creation.
  • Multiple matching filters all fire. When multiple filters match the same email, all actions from all matching filters are applied. If one filter archives and another does not, the email gets archived.
  • Body text matching is unreliable. The "Has the words" field searches visible text, not HTML markup. Exact phrase matching can be inconsistent.

When Gmail Filters Are Not Enough

Gmail filters work well for simple, rule-based sorting. But they have no concept of assignment, collaboration, or tracking. When your team starts running into these problems, filters alone will not solve them:

  • Two people reply to the same email because there is no ownership
  • You cannot see which emails have been answered and which have not
  • There is no way to add internal notes or context to a conversation
  • Reporting and metrics do not exist

A shared inbox like SupportBee turns your team email into a collaborative workspace. Every email becomes a ticket that can be assigned, tracked, and resolved - without losing the simplicity of email.

If you are currently using Gmail for team support, our guides on organizing your Gmail inbox, creating email templates, and automating emails in Gmail cover other ways to get more out of Gmail before making the switch.

Start your free 14-day trial - no credit card required.

Frequently Asked Questions

Can I create Gmail filters on my phone?

No. Gmail filters can only be created and edited on desktop (gmail.com or desktop app). However, filters you create on desktop apply to all incoming mail, including emails that arrive on mobile.

How do I use OR logic in Gmail filters?

Type OR (uppercase) between terms in the Has the words field. For example, urgent OR critical matches emails containing either word. OR logic works within a single field but not across different fields.

Do Gmail filters apply to old emails?

Only if you check Also apply filter to matching conversations when creating the filter. Otherwise, filters only apply to new incoming messages.

Can I apply multiple labels with one filter?

No. Each filter can apply only one label. To apply multiple labels, create separate filters with the same criteria, each applying a different label.

What happens when I forward emails with a filter?

Gmail sends a copy of matching emails to the forwarding address. The original stays in your account. You must verify the forwarding address before it can be used, and only 20 forwarding addresses can be used across all filters.