DEV Community

TiltedLunar123
TiltedLunar123

Posted on

Clean your inbox once, then make Gmail keep it that way

Every few months the same thing happens. You spend an evening deleting mail. The number drops. It feels great. Then by spring the inbox looks exactly the way it did before, and nothing actually broke, because the senders that filled it never stopped sending and a cleanup only ever deals with what has already landed.

So there are really two jobs here: a sweep for the backlog, and a standing rule for whatever shows up after that.

Gmail does the second job natively and almost nobody sets it up.

Build the rule out of a search you already trust

The mistake is opening filter settings and describing the mail you want gone from memory. Start from a search instead, and you get to see what it catches before you commit.

Google's own steps run like this. Open Gmail. Click Show search options in the search box. Enter your criteria, and you can click Search first to check what comes back. Then click Create filter at the bottom, choose what you want the filter to do, and click Create filter again.

Why search first? Because the result list is your safety check. If a query returns four things you would genuinely miss, you find that out before it becomes a standing rule rather than after.

Delete it does not mean gone

The word delete makes people nervous here, and it probably should not. Google is explicit about this. When you delete a message in Gmail, it goes to Trash. Up to 30 days after deletion you can find it there and move it back to your inbox. After 30 days it is permanently deleted and you cannot recover it.

So an auto-delete filter is really a soft delete with a month-long grace period. If your first rule turns out to be too aggressive, there are four weeks in which to notice.

Two consequences worth knowing: nothing frees up storage on day one, since mail sitting in Trash still counts against you until the Trash is cleared. And a filter you set up and forget will quietly start throwing things away for good a month later, which is fine when the rule is right and expensive when it is not.

A filter never touches what is already there

This is the part that surprises people. Filters run on mail as it arrives. Google says it plainly for forwarding: when you create a filter to forward messages, only new messages will be affected.

So can a filter clean the backlog for you? No. Build one against a sender with nine years of mail sitting in your account, and tomorrow's message gets handled while all nine years stay exactly where they were. Two tools; two jobs.

What to filter, and what to leave alone

Good candidates share one trait: you would not miss any individual message, and you know that because you already do not read them.

Which ones? Newsletters you have not opened in a year. App notifications about things you have already seen in the app. Marketing from a store you bought from once. Automated reports nobody reads. For those, a rule per sender is fine and delete is a reasonable action.

Leave alone anything you might need to prove later. Receipts. Order confirmations. Shipping notices. Anything from a bank or an insurer or a landlord or an employer or a government office. If there is any chance you will search for it in two years, label it instead (filters archive and label too), which clears your inbox without gambling on what your future self needs.

One more thing to skip: a rule that matches a common word in the subject line. Sender based rules tend to be boring and predictable. Keyword rules are how people accidentally delete something that mattered.

Check your filters twice a year

Filters are set and forget, which is exactly the risk. How long does a rule stay correct? Companies change sending domains, and a newsletter you ignored becomes one you want. Settings has the list, with Edit and Delete next to each one: ten minutes twice a year is plenty.

Now the backlog

None of this helps with the mail already in your account, which is usually the bigger number. Doing it by hand means searching by sender and then selecting and deleting and repeating until you run out of patience.

I build a Chrome extension for that half, Gmail One-Click Cleaner. Full disclosure, that one is mine. The piece that matters here is the storage scan, which ranks senders by how much space they actually use, so you clean the ones that count instead of the ones you happen to remember. It is on the Chrome Web Store and the code is on GitHub.

Sweep once. Then let a few rules hold the line.

Top comments (0)