DEV Community

TiltedLunar123
TiltedLunar123

Posted on

Gmail's Promotions tab is a guess your cleanup rule treats as a fact

Almost every Gmail cleanup starts with the same rule:

category:promotions older_than:6m
Enter fullscreen mode Exit fullscreen mode

It reads like a filter on a property of the message, when what it really filters on is a prediction, and bulk delete treats predictions and facts exactly the same way.

What category actually is

Google's help page is blunt about it. Gmail "automatically sorts your emails into these categories", and if you find something in the wrong one, "you can move it. Over time, this helps Gmail learn your preferences and sort your email more accurately."

Read that second sentence again. Slowly. It is describing a classifier that has been training on your behavior for as long as you have had the account, which means your category:promotions and mine do not hold the same kinds of mail, and neither one matches the shape either of us would draw on a whiteboard.

That is fine while you are searching, though only because a search is read only and being wrong costs you a scroll. It stops being fine the moment the same string drives a delete, since now every misfiled message is gone and you never read the batch it left in.

The mail that gets caught

The predictable casualties are order confirmations and receipts, since those arrive looking exactly like the mail around them. The classifier reads sender shape as much as content, and a receipt from a big retailer arrives through the same marketing pipes as that retailer's newsletters, so it lands next to them and your rule takes both.

Will you notice? Almost certainly not, and that is the actual problem. Four thousand newsletters and eleven receipts look identical as a number on a progress bar.

Two things in Google's own docs that fix most of this

First, there are more categories than the tabs show you. Google's operator reference lists two beyond the familiar five, and they hold roughly the receipt and booking mail you least want to lose. Subtract them:

category:promotions older_than:1y -category:purchases -category:reservations
Enter fullscreen mode Exit fullscreen mode

One line. It removes the worst class of mistake before anything moves, and it does that because you are naming the exceptions instead of hoping the classifier got them right.

Second, archived mail does not appear in categories. Google states that plainly on the same help page. It is easy to miss. Every category based sweep silently skips everything you already archived, which on an old account is usually the largest pile you own. Run a big cleanup and watch your storage number barely move? This is normally why.

Size searches avoid the trap entirely. That is because size is a real property of a message rather than an opinion about it:

has:attachment larger:10M older_than:1y
Enter fullscreen mode Exit fullscreen mode

The rule I would actually give you

How do you tell a safe operator from a risky one? Split them into two buckets, because the difference is not subtle once you look for it.

Facts about the message: larger:, older_than:, has:attachment, from:. These stay true no matter what any model thinks, so automate them freely. No caveats.

Opinions about the message: category:, is:important. These are guesses that get personalized to you while they quietly drift over time. Use them anyway, though run them read only the first time. Sort oldest first and page through looking for reference numbers, because that is exactly where the receipts hide.

Then protect at the subject level for words like invoice and confirmation, since those catch the receipts that slipped categories entirely.

And whatever does the deleting, make sure it labels the batch before it moves it. Gmail gives you no batch undo, so once four thousand messages are sitting in Trash beside mail you binned yourself, nothing tells them apart. The label applied on the way out is the only thing that makes the run reversible.

That last point is the one I care most about, and it is why the cleaner I build tags every run before touching anything and keeps a recovery log with one click restore. Full disclosure, that one is mine: Gmail One-Click Cleaner. The mailbox report and the storage breakdown are free, and the source sits on GitHub if you would rather read it than trust it.

The operators above are yours either way. Run them read only tonight and see how much of your Promotions tab is genuinely promotional.

Top comments (0)