Creating a Gmail rule takes three steps: find the email you want to filter, open the filter menu, and set the conditions and actions

A Gmail rule (called a filter in Gmail) automatically sorts incoming mail into folders, deletes it, marks it as read, or applies a label based on words in the sender, subject line, or message body. You build a rule by starting with an actual email, telling Gmail what to match, and choosing what to do with matching messages going forward.

The fastest way is to open any email from the sender or conversation you want to filter, click the three-dot menu in the top right, and select "Filter messages like these." Gmail will open a box showing what it will match — usually the sender's address. From there you choose an action: archive, delete, mark as read, apply a label, or skip the inbox. Click "Create filter" and the rule takes effect immediately on new mail.

Key Takeaways

  • You can create a filter from any email by clicking the three-dot menu and selecting "Filter messages like these."
  • Gmail filters can match on sender address, subject line words, or any text in the message body, and you can combine multiple conditions.
  • A single filter can perform one main action — archive, delete, mark as read, apply a label, or skip the inbox — plus optional secondary actions like adding a star.
  • Filters apply only to new incoming mail, not to messages already in your inbox, but you can apply a filter retroactively to past mail in one step.

The three-step filter menu: what each field does

When you click "Filter messages like these," Gmail shows you a box with fields for From, To, Subject, and Has the words. The From field is usually pre-filled with the sender's email address. You can leave it as is, remove it, or add more conditions.

The Subject field matches only the subject line — useful if you want to filter emails with a specific word like "invoice" or "receipt" regardless of who sends them. The Has the words field searches the entire message body and subject line together. You can type a single word, a phrase in quotes, or use operators like minus to exclude words: for example, "newsletter -unsubscribe" will match emails containing "newsletter" but not "unsubscribe."

The To field is less common but works if you have a shared inbox or forwarding address and want to filter mail sent to a specific recipient. Leave any field blank if you do not need it. Click the down arrow next to "Create filter" to see more options like filtering by attachment type or size, or by date range.

Choosing what happens to filtered mail

After you set the conditions, Gmail asks what to do with matching messages. You can choose one primary action: Skip the inbox (archive automatically), Mark as read, Apply label, Delete, or Forward to another address. Most people use "Skip the inbox" for newsletters and notifications they want to keep but not see in their main list.

You can also add secondary actions by checking boxes below the main action. These include Star it, Mark as important, or Never send to spam. For example, you might apply a label called "Receipts" and also mark the message as read so it does not clutter your unread count.

If you choose "Apply label," you can pick an existing label or type a new one. Gmail will create the label automatically if it does not exist. The label appears in your sidebar, and you can click it to see all filtered messages in one place.

Applying a filter to mail you already have

Filters only affect new mail going forward. If you want to apply the same rule to old emails already in your inbox, Gmail offers a checkbox at the bottom of the filter creation box: "Also apply filter to matching conversations." Check this box before you click "Create filter," and Gmail will retroactively sort all past messages that match the conditions.

This is useful when you set up a filter for a sender you have been receiving mail from for months. Without checking this box, only new messages from that sender will be filtered; old ones stay where they are. With it checked, Gmail moves or labels all of them at once.

Editing or deleting a filter you have already created

To change a filter after you have created it, go to Gmail Settings (click the gear icon in the top right, then "See all settings"), then click the Filters and Blocked Addresses tab. You will see a list of all your active filters. Click "Edit" next to the one you want to change, update the conditions or actions, and click "Update filter."

To delete a filter, open the same Filters and Blocked Addresses tab, find the filter, and click the trash icon next to it. Deleting a filter does not undo its past actions — mail that was already archived or labeled stays that way. The filter simply stops applying to new mail.

Common filter setups and what they do

A filter for newsletters: Set From to the sender's address or leave it blank, set Has the words to "unsubscribe" (most newsletters contain this word), and choose Skip the inbox. This catches bulk mail without blocking it entirely.

A filter for receipts: Set Subject to "receipt" or "order confirmation," apply a label called "Receipts," and optionally mark as read. This keeps your inbox clear while keeping receipts searchable in one place.

A filter for a specific project: Set Has the words to a project code or name, apply a label with the project name, and optionally star it. This groups all related mail in one label regardless of sender.

A filter to block a sender: Set From to the address and choose Delete. The mail goes straight to trash. (Gmail also has a "Block" button on individual emails that does this in one click.)

Frequently Asked Questions

Can I create a filter that does multiple actions at once?

You can choose one primary action (archive, delete, mark as read, apply a label, or forward) and add secondary actions like starring or marking as important. If you need a message to both apply a label and forward to another address, you would need two separate filters — one that labels it and one that forwards it.

What happens if two filters match the same email?

Gmail applies all matching filters in the order they appear in your Filters and Blocked Addresses list. If one filter archives a message and another labels it, the message gets both the label and is archived. If two filters conflict (one archives, one skips the inbox), the first one in the list takes priority.

Can I filter mail based on whether it has an attachment?

Yes. When you create a filter, click the down arrow next to "Create filter" to see advanced options. Check the box for "Has attachment" and Gmail will match only messages with files attached. You can combine this with other conditions like sender or subject line.

Do filters work on mail in other labels or folders?

Filters only apply to new mail as it arrives in your inbox. They do not retroactively sort mail in other labels unless you check "Also apply filter to matching conversations" when you create the filter. Once mail is in a label, a new filter will not move it unless you manually apply the filter to past conversations.

Can I pause or temporarily disable a filter?

Gmail does not have a pause feature for filters. To temporarily stop a filter, go to Filters and Blocked Addresses, click Edit, and delete it. You can recreate it later by going to Settings and clicking "Create a new filter" at the bottom of the Filters tab, or by finding an email that matches and using the three-dot menu again.