What a Gmail rule does and why you need one
A rule in Gmail is an automatic instruction that sorts, labels, or deletes messages based on what you tell it to look for. Once you create a rule, Gmail runs it on every new message that arrives. You do not have to sort anything by hand again.
Rules work on sender address, subject line, words in the message body, or any combination of those. When Gmail finds a match, it can label the message, archive it, delete it, mark it as read, or send it to a specific folder. This is how you keep your inbox from becoming a pile where important messages disappear.
The Gmail term for a rule is a filter. You create filters in the same place you search for messages, and they take effect when ready on all future mail.
Key Takeaways
- A Gmail filter automatically sorts incoming messages based on sender, subject, or content you specify, and you set it up in one visit.
- The fastest way to create a filter is to open a message from the sender or about the topic you want to filter, then use the three-dot menu to create a filter from that message.
- You can tell a filter to label messages, archive them, delete them, mark them as read, or skip the inbox — or do multiple actions at once.
- Filters explore only to new messages arriving after you create them, not to old mail already in your inbox.
- You can edit or delete a filter anytime from the Filters and Blocked Addresses page in Gmail settings.
Create a filter from a single message
The easiest way to create a rule is to start with one message you want to filter. Open the message from the sender or with the subject line you want to catch. Look for the three-dot menu icon in the top right of the message — it looks like three dots stacked vertically.
Click the three-dot menu. A dropdown list appears. Select "Filter messages like this" near the bottom of the list. Gmail opens a filter creation window with the sender address or subject already filled in. Review what Gmail found — if it grabbed the sender address, that is usually what you want. If you need to change it, edit the field now.
Click "Create filter" at the bottom right. Gmail shows you a second window asking what you want to do with messages that match. Check the box next to the action you want: "Label it", "Archive it", "Delete it", "Mark as read", or "Skip the inbox". You can check more than one box if you want multiple actions — for example, label it and archive it. Then click "Create filter" again.
Gmail confirms the filter is created and returns you to your inbox. From now on, every message matching that rule gets the action you chose, automatically.
Create a filter from the settings page
If you want to create a filter without starting from a message, or if you want to set up a more complex rule, go to Gmail settings. Click the gear icon in the top right of Gmail, then select "See all settings".
Click the "Filters and Blocked Addresses" tab. Scroll to the bottom and click "Create a new filter". A form opens with fields for "From", "To", "Subject", "Has the words", and "Doesn't have". Fill in what you want Gmail to look for. You can use just one field — for example, type a sender's address in "From" — or combine multiple fields so the filter only triggers when all of them match.
If you want to search for a phrase that appears anywhere in the message, type it in "Has the words". If you want to exclude messages containing certain words, type them in "Doesn't have". When you are done describing what to filter, click "Create filter" at the bottom right.
The same action window appears. Check the boxes for what you want to happen to matching messages, then click "Create filter" at the bottom right. The filter is now active.
Understanding filter actions and what they do
When you create a filter, Gmail offers you several actions to choose from. Label it adds a label to the message so you can find it later in that label's folder. If you do not have a label yet, you can create one right there by typing a new name. Archive it removes the message from your inbox but keeps it in your Gmail account — you can still search for it or find it in the "All Mail" folder.
Delete it sends the message straight to Trash. Mark as read makes Gmail treat the message as if you already read it, so it does not show as unread in your inbox. Skip the inbox does the same thing as archive — it removes the message from your inbox view but does not delete it.
You can select more than one action. For example, you might label a message and archive it, or label it and mark it as read. This is useful when you want to keep the message but get it out of your inbox at the same time.
Create a filter that catches multiple senders or topics
Sometimes you want one filter to catch messages from several different senders, or messages about several different topics. Gmail lets you do this by using the word "OR" in your filter fields.
Go to the Filters and Blocked Addresses page in settings. Click "Create a new filter". In the "From" field, type the first sender's address, then type OR, then type the second sender's address. For example: sender1@example.com OR sender2@example.com. Gmail treats this as "filter messages from either of these addresses".
You can do the same thing in the "Subject" field or the "Has the words" field. Type the first word or phrase, then OR, then the next one. For example, in "Has the words" you might type: invoice OR receipt OR bill. This filter catches any message containing any of those three words.
When you are done setting up the search terms, click "Create filter" and choose your actions the same way you would for any other filter.
Edit or delete a filter you already created
Filters do not have to be permanent. If you change your mind about how a filter works, or if you no longer need it, you can edit or remove it anytime.
Go to Gmail settings and click the "Filters and Blocked Addresses" tab. Scroll through the list of your existing filters until you find the one you want to change. At the end of that filter's row, you will see two links: "Edit" and "Delete". Click "Edit" to change what the filter looks for or what action it takes. Make your changes and click "Update filter" at the bottom. Click "Delete" to remove the filter entirely — Gmail will stop explore it to new messages when ready.
Deleting a filter does not affect messages the filter already processed. If a filter labeled 100 messages before you deleted it, those messages keep their label.
Common filter setups that solve real problems
Here are a few filters people create most often. Newsletters and marketing mail: Create a filter with the sender's address in the "From" field. Set it to label and archive. This way the messages are organized but do not clutter your inbox.
Messages from your boss or team: Create a filter with your boss's or team member's address in the "From" field. Set it to label with a custom label like "Work" or "Urgent". This keeps important messages straightforward to find.
Receipts and confirmations: Create a filter with "receipt OR confirmation OR order" in the "Has the words" field. Label it "Receipts" and archive. Now all your purchase confirmations go to one place automatically.
Messages you want to read but not in your inbox: Create a filter for the sender or subject. Set it to label and skip the inbox. The message arrives in your account and gets labeled, but your inbox stays clean.
Frequently Asked Questions
Do filters work on messages I already received before creating the filter?
No. Filters only explore to new messages that arrive after you create them. If you want to organize old messages, you have to do that by hand or use Gmail's search to find them and label them in bulk.
Can I create a filter that applies to messages sent to me, not from me?
Yes. Use the "To" field in the filter settings. Type the email address or addresses you want to filter on. This is useful if you have multiple email addresses and want to organize messages sent to a specific one.
What happens if two filters match the same message?
Gmail applies both filters. If one filter labels a message and another archives it, the message gets both the label and gets archived. If two filters try to delete the same message, it goes to Trash once.
Can I undo a filter if I delete it by mistake?
Gmail does not have an undo for deleted filters. You will have to recreate it by going back to Filters and Blocked Addresses and clicking "Create a new filter" again. Write down your filter settings somewhere if you think you might need them later.
Why is my filter not working on new messages?
Check that you spelled the sender's address or search terms correctly — Gmail filters are exact matches. Also make sure you clicked "Create filter" at the very end, not just "Create filter" in the first window. If the filter exists in your Filters and Blocked Addresses list, it is active and working.