Gmail Cleanup Search Builder

Most Gmail cleanups stall on the same step: typing the right search. Searches like older_than:2y larger:10M work well, but few people remember the syntax, and one wrong word can match mail you meant to keep.

Pick a common cleanup or set your own age, size and sender, then copy the search into Gmail. Read the results, select them, and delete. Starred and important emails are left out by default, so the search skips the messages you have already flagged as worth keeping.

How to use the search in Gmail

  1. Copy the search above, or click Open in Gmail to run it directly (this works on a computer).
  2. Paste it into the search bar at the top of Gmail and press Enter.
  3. Scroll the first page of results. If anything you need shows up, add a rule in step 2 or star it.
  4. Tick the select-all box above the list. Gmail then shows a link that selects every matching conversation, not just the first page.
  5. Click Delete. The mail moves to Trash, where it stays for 30 days before Google removes it for good (Google).

For the full walkthrough, see how to bulk-delete Gmail messages on a computer.

Ready-made searches for common cleanups

GoalSearch to pasteWhat it finds
Free up the most spacelarger:10M -is:starred -is:importantEmails over 10 MB, usually photo or video attachments
Clear old shopping mailcategory:promotions older_than:1y -is:starredPromotions tab mail older than one year
Find senders to unsubscribe fromcategory:promotions is:unread older_than:6mPromotions you never opened in the last six months or more
Remove old attachmentshas:attachment older_than:3y -is:starredAny attachment older than three years
Clear social notificationscategory:social older_than:6mSocial tab alerts older than six months
One sender’s back catalogfrom:[email protected] older_than:1yEverything older than a year from one address
Mail you never filedhas:nouserlabels older_than:5y -is:starredOld mail without any of your own labels

What each part of the search means

PartMeaningExample
older_than:Older than a period, in days (d), months (m) or years (y)older_than:2y
before:Received before a date, written YYYY/MM/DDbefore:2023/01/01
larger:Bigger than a size, attachments includedlarger:5M
has:attachmentHas any attachmenthas:attachment
filename:Has an attachment of a type or namefilename:pdf
category:In an inbox tab, if your inbox uses tabscategory:promotions
from:Sent by an address, domain or namefrom:example.com
is:unreadNever openedis:unread
-is:starredLeaves out starred mail (the minus sign excludes)-is:starred
has:nouserlabelsOnly mail without any of your own labelshas:nouserlabels

These operators come from Google’s own list of Gmail search operators.

Check these before you delete

  • Exclusions work per message. Gmail matches individual messages first, so a conversation can still appear when one message in it is starred. Open long threads before deleting them.
  • Receipts and records hide in Promotions. Order confirmations, tickets and warranty emails often land there. Search category:promotions receipt or order first and keep what you need.
  • Deleting is not archiving. Archived mail still counts toward your storage. To free space, the mail has to be deleted and then leave Trash.
  • Stop the flow too. If one sender keeps filling the search, unsubscribe from them in Gmail so the cleanup lasts.

Using these searches on your phone

The Gmail app accepts the same searches. Paste one into the search bar at the top and press search. On Android, Select all picks up to 50 messages at a time (Google), so large cleanups are much faster on a computer. See how to delete multiple Gmail messages on your phone for the phone steps.

Related guides

    The 15-Minute Phone Rescue Checklist

    A free one-page PDF that frees phone storage in a safe order. Enter your email and we will send you the download link.

    We only use your email to send the checklist and never share it.

    Search operators checked against Google’s Gmail Help in November 2026.

    Sources