Gmail rules sort your mail automatically so you don't have to

A Gmail rule (called a filter) automatically sorts incoming mail into folders, adds labels, marks messages as read, or deletes them based on words you choose. Once you create a rule, Gmail applies it to every new message that matches — so if you set a rule for emails from your bank, every future bank statement goes straight to a folder without cluttering your inbox.

You create rules in Gmail's settings in about two minutes. The process is the same whether you use Gmail on a computer or phone, though the phone version is slightly more limited. Rules work on all your devices once you set them up.

Key Takeaways

  • Gmail rules are created in Settings under the Filters and Blocked Addresses tab, and you search for the emails you want to filter first to make sure the rule targets the right messages.
  • A single rule can sort mail by sender, subject line words, file attachments, or any combination of those, and apply multiple actions at once like labeling and archiving.
  • Rules apply only to new incoming mail, not to emails already in your inbox, so you will need to manually sort old messages if you want them organized the same way.
  • You can test a rule before finalizing it by clicking "Create filter" to see how many existing emails would match, which prevents mistakes like accidentally filtering out important messages.

How to create a basic rule by sender

Open Gmail in a web browser and go to Settings (the gear icon in the top right). Click "See all settings," then select the "Filters and Blocked Addresses" tab. Click "Create a new filter" at the bottom of the page.

In the "From" field, type the email address you want to filter — for example, noreply@bank.com if you want all statements from your bank to go to one folder. Leave the other fields blank for now. Click "Create filter" at the bottom right.

Gmail will show you how many emails in your account match that sender. If the number looks right, click "Create filter" again to confirm. If it seems too high or too low, click the back arrow and adjust the sender address.

Choosing what the rule does with matching emails

After you click "Create filter" the second time, a new window opens with action options. Check the box next to the action you want: "Skip the Inbox" (archive automatically), "Apply the label" (move to a folder), "Mark as read," "Star it," or "Delete it." You can select more than one action — for example, you could label an email and archive it at the same time.

If you choose "Apply the label," a dropdown menu appears. Select an existing label or type a new one. Gmail will create the label if it doesn't exist yet. Click "Create filter" at the bottom to save your rule.

The rule is now active. Any new emails from that sender will follow the actions you chose. Emails already in your inbox will not be affected — you will need to manually sort those if you want them organized the same way.

Creating rules based on subject lines or keywords

Go back to Settings > Filters and Blocked Addresses > Create a new filter. This time, leave the "From" field empty and type a word or phrase in the "Subject" field instead. For example, type receipt to catch all emails with that word in the subject line.

You can also use the "Has the words" field to search for keywords anywhere in the email body or subject. Type the word and click "Create filter." Gmail shows you how many emails match. If the number is what you expected, click "Create filter" again and choose your actions.

Be specific with keywords to avoid catching unrelated mail. Searching for "order" might catch both shipping confirmations and customer service replies, so you may need to refine the word or combine it with a sender address to make the rule more precise.

Rules for emails with attachments

In the Create a new filter window, check the box labeled "Has attachment." This rule will catch every incoming email with a file attached, regardless of sender or subject. Click "Create filter" and choose your actions.

This is useful if you want all invoices or documents automatically labeled and archived. However, the rule will also catch casual attachments like photos from friends, so you may want to combine it with a sender address or keyword to narrow it down — for example, "From: accounting@company.com" and "Has attachment" together.

Testing a rule before you finalize it

Before you click "Create filter" on the action screen, Gmail shows you a preview: "This filter will now be applied to all incoming mail." Below that, it tells you how many existing emails would match if the rule had existed when they arrived. This number helps you catch mistakes.

If the preview shows 500 matches and you only expected 5, go back and adjust your filter criteria. For example, if you typed "the" as a keyword, almost every email will match. Click the back arrow, change "the" to something more specific like "invoice," and try again.

Once the preview looks correct, click "Create filter" to apply the rule to all new incoming mail.

Editing or deleting a rule you already created

Go to Settings > Filters and Blocked Addresses. Scroll down to see all your existing rules. Find the one you want to change and click "Edit" next to it. You can modify the search criteria (sender, subject, keywords) or the actions (label, archive, delete). Click "Update filter" to save changes.

To delete a rule entirely, click "Delete" next to it. Gmail will ask you to confirm. Once deleted, the rule stops applying to new mail, but it does not undo actions on emails that already matched the old rule — those emails stay where they are.

Frequently Asked Questions

Do rules work on emails I already have in my inbox?

No. Rules only apply to new incoming mail from the moment you create them. If you want to organize old emails the same way, you will need to manually select them and apply the label or action yourself. Gmail does not retroactively apply rules to your existing messages.

Can I create a rule that moves emails to a specific folder?

Gmail does not have traditional folders, but labels work the same way. When you create a rule and select "Apply the label," you can choose an existing label or create a new one. The email will appear under that label, and you can archive it from your inbox at the same time so it does not clutter your main view.

What happens if two rules match the same email?

Gmail applies all matching rules in the order you created them. If one rule labels an email and another archives it, both actions happen. If two rules try to apply different labels, both labels are added. This is usually helpful, but if you want to prevent it, you can add more specific criteria to one rule so it does not overlap.

Can I create a rule on my phone?

The Gmail app on iPhone and Android does not have a full filter creation tool. You can create rules only through the Gmail website on a computer or mobile browser. Once created on the web, rules work on your phone automatically — new matching emails will be sorted the way you set them up.

How do I create a rule to skip the inbox but keep the email?

Check the "Skip the Inbox" box when you create the rule. This archives the email automatically so it does not appear in your inbox, but it stays in your account under the label you chose (or in All Mail if you do not apply a label). You can still search for it or find it by label whenever you need it.