Gmail storage is shared with Google Drive and Photos, so years of advertising emails eat into the same 15 GB. One search finds the ads and skips your own notes, attachments, starred mail and anything mentioning words you care about. Then you delete every match in one go.

Paste this into Gmail’s search bar:

category:promotions -from:me -has:attachment -is:starred -project -invoice -receipt

project, invoice and receipt are examples. Swap in your own words, such as course codes, your company name or a club. Each one goes in with a - in front.

PartWhat it does
category:promotionsOnly looks in the Promotions tab, where ads and newsletters land
-from:meSkips anything you sent, including notes and files you emailed to yourself
-has:attachmentSkips any email carrying a file, so PDFs, photos and reports stay
-is:starredSkips anything you starred
-project -invoice -receiptSkips any email that mentions one of these words

The - means “not”. Gmail joins every part with “and”, so an email is matched only if it passes all of them.

How the search sieves your inbox

FILTER CHAINLEFT ALONEEvery email in your accountcategory:promotionskeeps only the Promotions tabPrimary, Social, Updates tabs-from:medrops mail you sentNotes sent to yourself-has:attachmentdrops mail with filesPDFs, photos, reports-is:starreddrops starred mailAnything you starred-project -invoice -receiptdrops mail with your protected wordsMail with your wordsselect all, deleteAds only → Trashrecoverable for 30 daysEmpty Trash nowStorage freedshared by Gmail, Drive and Photos

Each filter lets a group out to the right, and those emails are never touched. Only mail that gets through all five is selected and sent to Trash.

Click by click

  1. Paste the search into Gmail and press Enter. Add your own protected words first.
  2. Switch the results to “Most recent”. Click “Showing most relevant” above the list and choose “Most recent”. In “Most relevant” mode Gmail hides the option to select every match.
  3. Scroll through a page or two. Check that only ads are listed. If something you want shows up, add a word from it to the search with a - in front and search again.
  4. Tick the select-all box, then click “Select all conversations that match this search”. The checkbox alone selects only the 50 emails on screen. The link that appears above the list extends the selection to every match.
  5. Click the trash-can icon and confirm. Gmail works through the batch in the background, newest first. Thousands of emails can take from a few minutes to over an hour. Keep the tab open and refresh to watch the dates get older.
  6. Empty Trash to get the space back. Open Trash and choose “Empty Trash now”. If you don’t, Gmail clears it after 30 days and your storage drops then.

Emptying Trash cannot be undone

Until Trash is emptied, anything deleted by mistake can be moved back to the inbox. Skim Trash once before you click “Empty Trash now”. After that the emails are gone for good.