Gmail: Search Operators, Undo Send, and Filters
Posted in Guides on June 30, 2023 by Oliver Abdulrahim ‐ 3 min read
Looking for something? Search it!
Ever tried to find an email that someone sent you a long time ago, but you can’t exactly remember what was in it? You’re in luck! Each search operator listed below can help you find a specific message or set of emails across your entire mailbox.
Search operator reference
To use these, simply enter the operator along with its required arguments in the Gmail search bar.
With specific people
Operator | What it does | Example |
---|---|---|
to: | Matches emails you’ve sent to that address | to:info@conservationco.org |
from: | Matches emails you’ve received from that address | from:example@gmail.com |
cc: , bcc: | Matches emails where that address received a copy | bcc:oliver |
In a specific place
Operator | What it does | Example |
---|---|---|
in | Matches a label like chats , anywhere , inbox , trash , spam , important , unread , starred | in:my-amazing-label |
You can generally use operators in
, label
, and is
interchangeably!
From a specific time
Operator | What it does | Example |
---|---|---|
before: | Messages before a given date | before:2021 |
after: | Messages after a given date | after:2023-01-01 |
These operators accept arguments in date formats like:
YYYY
YYYY-MM
YYYY-MM-DD
MM-DD-YYYY
DD-MM-YYYY
With specific attachments
Operator | What it does | Example |
---|---|---|
has: | Matches messages with a attachment , drive , presentation , document , spreadsheet or youtube | has:attachment |
filename: | Matches messages with an attachment of a given name or type | filename:pdf |
Word matching
Operator | What it does | Example |
---|---|---|
AROUND | Match messages with these terms n words near each other | coupon AROUND 100 tacos |
"" | Match messages with this exact phrase | "free shawarma" |
+ | Include only messages that match what follows | +coupon |
- | Exclude all messages that match what follows | -bill , -in:spam |
General use filters
Operator | What it does | Example |
---|---|---|
OR | Include messages that match multiple operators | label:spam OR label:trash |
() | Include messages with all these search terms | subject:(cafe restaurant) |
Examples
You can combine operators together or use them individually. Here are some quick examples.
Example | What it does |
---|---|
subject:(invoice OR receipt) has:attachment after:2023-06-01 | Finds all emails containing this month’s invoices |
before:2023-06-01 after:2023-01-01 from:someone@example.org | Finds all emails in the first half of 2023 sent by a specific person |
is:unread -label:archived -label:spam | All unread messages, excluding archived and spam emails |
You can even bookmark any of these to jump to them easily later!
After executing the search, press ⌃ Ctrl + D
(Windows & Linux) or
⌘ Cmd + D
(macOS) to save it in your browser.
Sent a message accidentally? Undo it!
If you sent a message before finishing it, made a typo, or you sent it to the wrong person, you can unsend that email! Look for this button in the bottom of your screen on mobile and desktop.
There’s an unsend period after you click send. Update the length of that time with this setting:
- In Gmail, click ⚙️ Settings, then the “See all settings” button
- In the “General tab”, look for the section “Undo Send”
- Pick an undo period (30 seconds is the longest option)
- Click “Save changes”
Filtering messages automagically
If you have a system you use to label messages, or you’re always forwarding a specific type of message to others, you can use filters to automatically accomplish this and more!
For example, you could categorize all messages with articles and news into your “Read later” label.
Follow these steps to create a filter:
- In Gmail click on “🔍 Search in mail”
- Type what messages you want to apply your filter to. You can use search operators here just like any other search!
- To the right of the search bar, click on “Show search options”
- Click “Create filter”
- Update the options that appear.
- For example, you could check “Apply the label” and combine this with “Skip the Inbox (Archive it)” to keep your inbox clear
- Click “Create filter”. All done!