To delete old emails in Gmail, search for older_than:1y (or any age you like), select every matching conversation, and click the trash can. Then empty the Trash so the space comes back right away. The whole thing takes about a minute on a computer.
The quick version:
- Open Gmail in a web browser on your computer.
- Type
older_than:1yinto the search bar and press Enter. Swap1yfor6m,2y,90d, and so on. - Click the select all checkbox above the results.
- Click Select all conversations that match this search. Without this step, Gmail only selects the first page of 50.
- Click the trash can icon and confirm.
- Open Trash and click Empty Trash now to free the storage immediately.
That clears out your old mail once. Gmail has no built-in setting that keeps deleting emails as they get old, so the rest of this guide covers how to narrow the search so you don't lose anything important, how to do this on your phone, and three ways to make it automatic.
How to Delete Old Emails in Gmail

Step 1: Search for emails by age
Gmail's older_than: search operator finds every email older than a given age. The format is older_than: followed by a number and a unit: d for days, m for months, or y for years.
| Search | What it finds |
|---|---|
older_than:1y | Emails older than one year |
older_than:6m | Emails older than six months |
older_than:90d | Emails older than 90 days |
before:2024/01/01 | Emails received before January 1, 2024 |
older_than:2y category:promotions | Promotional emails older than two years |
older_than:1y -is:starred -is:important | Old emails that aren't starred or marked important |
Gmail doesn't accept decimals, so write older_than:18m rather than older_than:1.5y. If you'd rather use an exact cutoff date, before:YYYY/MM/DD does the same job.
To delete only the messages you never opened, add is:unread. A search like is:unread older_than:1y is the usual one when an unread pile has been sitting for years. The full steps, including what the Gmail app will and won't select, are in how to delete all unread emails in Gmail.
Step 2: Protect the emails you want to keep
A bare older_than:1y search catches everything, including receipts, tax documents, and messages from family. Before you delete, narrow the search:
- Skip starred and important mail: add
-is:starred -is:important. - Target the real clutter: add
category:promotionsorcategory:social. These categories are usually the bulk of an old inbox, and almost nothing in them is worth keeping. - Exclude a sender or label: add
-from:bank.comor-label:Taxes. - Go after storage hogs: add
larger:5Mto find old emails with big attachments.
A safe all-round search for most people is:
older_than:1y -is:starred -is:important -label:keep
Scroll through a page or two of results before you delete. If you spot something you need, star it, and it drops out of the search.
Step 3: Select every matching email
Click the checkbox in the top-left corner above your email list. Gmail selects only the conversations on the current page (usually 50), then shows a link at the top of the list: Select all conversations that match this search. Click it, or you'll only delete the first page.
Step 4: Delete them and empty the Trash
Click the trash can icon. Gmail asks you to confirm the bulk action; click OK. Very large deletions (tens of thousands of emails) can take several minutes to finish in the background.
Deleted emails sit in Trash for 30 days, and they still count toward your 15 GB of Google storage during that time. To get the space back now, open Trash from the left sidebar (under More) and click Empty Trash now.
How to Delete Old Emails in Gmail on iPhone or Android
The Gmail app can search with older_than:, but it has no select all option. You can only long-press emails and tap them one at a time, which isn't practical for thousands of messages.
The workaround is to open Gmail in your phone's browser, switch to the desktop version, and follow the steps above. Or wait until you're at a computer. If you'd like cleanup to happen without opening Gmail at all, use one of the automatic options below.
Can Gmail Delete Old Emails Automatically?
Not on its own. Gmail has no "delete emails after X days" setting. Filters come close, but they only act on emails as they arrive, not on mail that's already sitting in your inbox and getting older. You have three ways around that.
Option 1: A filter for new emails (free, partial)
Filters can stop specific senders from piling up in the first place:
- Click the gear icon, then See all settings, then Filters and Blocked Addresses, then Create a new filter.
- Enter the sender in From, or a word in Has the words, such as
category:promotions. - Click Create filter, check Delete it, and save.
When you create the filter, Gmail also offers Also apply filter to matching conversations. If you put older_than:1y in Has the words and check that box, Gmail deletes your existing old emails once. It won't keep doing it as more emails cross the one-year mark, though: a filter only runs once on each message, when it arrives.
Tip: If you're nervous about deleting, choose Apply the label with a label like "Pending deletion" instead. Review it after a week, then switch the action to Delete it.
Option 2: A Google Apps Script (free, requires a little code)
Google Apps Script can run a search on a schedule and trash whatever matches, which gives you true age-based auto-delete.

- Go to script.google.com and create a new project.
- Paste in this script:
function deleteOldEmails() {
// Edit the search to change what gets deleted.
var query = 'older_than:1y -is:starred -is:important';
var threads = GmailApp.search(query, 0, 100);
while (threads.length > 0) {
GmailApp.moveThreadsToTrash(threads);
threads = GmailApp.search(query, 0, 100);
}
}
- Click Run once and approve the Gmail permissions.
- Click the Triggers (clock) icon, then Add Trigger. Choose
deleteOldEmails, Time-driven, and Day timer, then save.
From then on, the script runs every day and trashes anything that has aged past your cutoff. Apps Script has daily quotas and a six-minute limit per run, so on a very large inbox the first cleanup may take a few days of runs to finish. After that, each daily run only has a handful of emails to trash.
sbb-itb-34b9fd2
Option 3: MailSweeper (no code, fully automatic)

If you'd rather not maintain a script, MailSweeper does the same job for you:
- One-time cleanup: when you connect Gmail, MailSweeper finds years of old promotions, social updates, and newsletters and clears them out in bulk.
- The Dustpan: new clutter is labeled and routed into a "Dustpan" label, out of your inbox. Starred, important, and Primary inbox emails are never touched.
- Scheduled sweeps: you choose how old Dustpan emails need to be, such as 30 or 90 days, and MailSweeper moves them to the Trash on schedule. You never have to search for old emails again.
- One-click unsubscribe: fewer emails coming in means less to delete later.
Deleted emails go to Gmail's Trash, so anything can be restored for 30 days. MailSweeper is CASA certified and never stores or sells your email. It costs $24/year with a 14-day free trial, or $99 once for lifetime access.
Which Method Should You Use?
| Gmail search | Gmail filter | Apps Script | MailSweeper | |
|---|---|---|---|---|
| Deletes existing old emails | Yes, by hand | Once | Yes | Yes |
| Keeps deleting as emails age | No | No | Yes | Yes |
| Protects starred/important mail | If you add it to the search | If you add it to the filter | If you add it to the script | Always |
| Setup | 1 minute | 2 minutes | 10–15 minutes, some code | 2 minutes |
| Works from your phone | Desktop site only | Desktop site only | No | Yes |
| Cost | Free | Free | Free | $24/yr or $99 once |
- Just need space back today? Use the
older_than:search and empty the Trash. - Comfortable with a little code? The Apps Script gives you free auto-delete.
- Want it handled for good? MailSweeper runs the cleanup, the sweeps, and the unsubscribes for you.
FAQs
How do I delete emails older than 1 year in Gmail?
Search for older_than:1y, click the select-all checkbox, then click Select all conversations that match this search, and click the trash can. Add -is:starred -is:important to the search to protect emails you've flagged.
How do I delete all old emails in Gmail at once?
Use a search like before:2025/01/01, select all matching conversations with the Select all conversations that match this search link, and delete. Gmail handles tens of thousands of emails in a single bulk action, though it can take a few minutes. See how to delete all Gmail emails at once for the select-all steps, including phone limits.
Why didn't deleting old emails free up my Gmail storage?
Deleted emails stay in Trash for 30 days and keep counting against your storage. Empty the Trash, then give Google up to a day to update the storage meter. If space is still tight, search for larger:10M because a few big attachments often take up more room than thousands of plain emails.
How do I find my oldest emails in Gmail?
Search for before:2015/01/01 (or an earlier year) and work forward, or open All Mail and click the "1–50 of many" counter, then choose Oldest. Our guide to finding your oldest emails in Gmail walks through both.
Can I recover old emails I deleted by mistake?
Yes, for 30 days. Open Trash, select the emails, and click Move to Inbox. After 30 days, or once you empty the Trash, they're gone for good, so consider exporting anything important with Google Takeout before a big cleanup. The full steps, and what is left after Trash is emptied, are in how to recover deleted emails in Gmail.
Is it safe to use a third-party tool to delete old Gmail emails?
Look for a tool that has passed Google's CASA security assessment, that sends deleted mail to Trash instead of erasing it, and that lets you exclude starred and important emails. MailSweeper does all three. Comparing options? See MailSweeper vs. Trimbox.
