DEV Community

TiltedLunar123
TiltedLunar123

Posted on

The Gmail search operators I use to clear storage instead of paying Google for more

Google's answer to a full Gmail is a button that sells you more storage. There's a cheaper one, and it's the search bar you already have. Gmail's search operators can find the exact mail that's eating your 15 GB, and you can clear most of it in a few passes. Here's the order I actually run them in.

Start with size, because attachments are the real hogs

Text emails are tiny. What fills a Gmail account is attachments. So the first search is always this:

larger:10M
Enter fullscreen mode Exit fullscreen mode

That surfaces every message over 10 MB. Sort through a screen of those and you'll usually find old design files, phone-camera dumps, and PDFs you forwarded to yourself years ago. Delete a dozen of those and you've often freed more space than deleting ten thousand text emails would.

Then step down a tier:

larger:5M older_than:1y
Enter fullscreen mode Exit fullscreen mode

Adding older_than:1y keeps recent stuff you might still need out of the results. You can use older_than:6m, older_than:2y, whatever cutoff you trust.

Then clear the categories that refill on their own

Promotions and social notifications arrive constantly and you almost never go back to read them. Gmail already sorts them, so you can target them directly:

category:promotions older_than:6m
category:social older_than:1y
category:updates older_than:1y
Enter fullscreen mode Exit fullscreen mode

The older_than piece matters here. It's the difference between clearing genuine clutter and accidentally trashing the shipping notification for the thing that hasn't arrived yet.

Catch the no-reply senders

A lot of clutter comes from addresses that can't receive mail anyway. This finds them:

from:no-reply older_than:1y
from:noreply older_than:1y
Enter fullscreen mode Exit fullscreen mode

Newsletters and receipts often come from these. Skim before you delete, since some receipts are worth keeping, but most of it is safe to clear.

Useful modifiers to combine

A few operators make the searches sharper:

  • has:attachment limits results to messages with files.
  • is:unread finds mail you never even opened, which is usually the safest to delete.
  • -in:starred excludes anything you've starred, so you don't touch flagged mail.
  • before:2023/01/01 targets a hard date instead of a relative age.

Stack them. category:promotions has:attachment older_than:1y -in:starred is a very safe, very productive delete.

One thing the operators can't tell you

Search is great at finding mail by rule. It's bad at answering "which senders are actually eating my storage?" Gmail won't rank your space by sender, so you end up eyeballing larger: results and guessing.

That gap is most of why I built Gmail One-Click Cleaner. It runs these same size searches for you, attributes the space back to the senders behind it, and shows your top storage hogs so you're not guessing. It runs the category and no-reply sweeps as one-click presets too, and every run has a Restore button, so if you clear something you wanted back, one click puts it in your inbox. It's free, open source, and nothing leaves your browser.

But you don't need it to start. Open your Gmail, type larger:10M, and see what's been sitting there. Most people are surprised how fast the number drops.

The habit that keeps it clean

Doing this once helps. Doing it every month or two is what keeps you off the "storage almost full" banner for good. Pick a cutoff you're comfortable with, run the size search and the category sweeps, and you'll reclaim gigabytes on a schedule instead of panicking when Google tells you you're out.

Top comments (0)