Sandro Turriate

Coder, cook, explorer

Advanced Gmail search to help you organize your inbox.

Jan 7, 2021

TLDR

Paste this snippet into your Gmail search bar:

1
unsubscribe -shipping -payment -card -"YOUR ADDRESS" -order -package -track -"tracking number" -"order number" -confirmation -from:Robinhood -from:YOURBANK -from:"Whole Foods Market" in:inbox is:unread older_than:7d -is:important -is:starred -is:snoozed has:nouserlabels -has:attachment

This search finds mail that’s unread in my inbox, 7 days old, containing the word “unsubscribe,” not containing my mailing address or terms that look like an order was placed, and mail that does not appear “important,” by Gmail’s standards or because of some other user interaction (labeling, snoozing, starring, etc.)

I use this filter to help me find mail that I need to unsubscribe from and delete!

Let’s break down what the query does.

unsubscribe
contains the word “unsubscribe”
-shipping -payment -card -"tracking number"
Does not contain the words “shipping,” “payment,” “card,” or “tracking number”
-order -package -track -"order number"
Does not contain words that suggest a purchase or delivery was placed
-confirmation
Does not contain the word “confirmation”
-"YOUR ADDRESS"
Type in your mailing address. I want to keep any mail that contains my mailing address because it’s likely about something I purchased.
-from:Robinhood -from:YOURBANK -from:"Whole Foods Market"
Do not find email coming from Robinhood, my bank, or Whole Foods
in:inbox
only find mail in my inbox.
is:unread
Email I haven’t opened
older_than:7d
Email received over 7 days ago.
-is:important
Not labeled as important.
-is:starred
Email that has not been starred.
-is:snoozed
Email that has not been snoozed.
has:nouserlabels
Email that has not already been sorted or filtered
-has:attachment
Email without an attachment. I give an “unsubscribe” email with an attachment higher priority than other emails.

Every term in the query narrows the results further, so combining them surfaces only the emails most likely to be newsletters I no longer want. Once the list is filtered, I can quickly unsubscribe, archive, or delete each one — and keep the few messages that matter.

Hunting the mailing lists behind your newsletters

Many of the “unsubscribe” emails clogging your inbox are sent through mailing lists — services that let one sender reach thousands of subscribers at once. Gmail tags these messages with special email headers (List-Id and List-Post), and the list: search operator lets you target them directly.

1
list:info@example.com

The syntax takes the mailing list’s address. So list:info@example.com finds every email that came in through that one list. Unlike a from: search, this works even when the list is sent from a generic address, because Gmail reads the mailing-list header rather than just the sender field. It’s the cleanest way to round up all the digests and updates from a single provider at once.

You can pair it with in:inbox to narrow things further:

1
list:info@example.com in:inbox

in:inbox restricts results to mail still sitting in your inbox — anything you’ve already archived, sent, or trashed is excluded. Combined, the query returns only the mailing-list messages from that address that you haven’t processed yet.

This is a handy complement to the unsubscribe search above. Where the main query hunts for raw “unsubscribe” email, list: lets you attack the problem by sender. If a particular list keeps flooding your inbox, run list:THEIRADDRESS in:inbox is:unread to see everything from them that’s still waiting on you — then review, archive, or unsubscribe in one pass.