How to Auto-Delete Emails in Gmail
Before we begin, it’s important to understand what Gmail’s built-in filters can and cannot do:
✅ Gmail filters do work to automatically delete new incoming emails that match your rules.
❌ Gmail filters do not automatically delete existing emails as they age — there is no native “auto-delete after X days” feature.
If your goal is to keep your inbox clean over time by removing older emails automatically, you’ll need to combine filters with manual cleanup or use advanced tools like Clean Email to fully automate the process. These guides will show you all the options — and what works best for different needs.
- Create a Gmail rule → Delete by sender, subject, or keyword
- Delete after X days? → Manual & automated options
- Smart automation → Use Clean Email rules
- Prefer code? → Try a Google Script
- Spam overload? → Auto-delete junk mail
- Target keywords? → Auto-delete by content or subject
- On mobile? → Clean up Gmail on your phone
- Losing emails unexpectedly? → Stop Gmail from auto-deleting them
- Inbox bloated? → Extra tools from Clean Email
- Still unsure? → Jump to FAQ
How to create a rule in Gmail to delete emails
⚠️ Problem: I need to automatically delete unwanted emails in Gmail from certain senders, subjects, keywords.
✅ Solution: To set up Gmail for automatically deleting emails, you can create an inbox filter. Filters are basically Gmail rules that let you define conditions and automatically apply actions to emails that match those conditions.
When you create a filter in Gmail to automatically delete emails, you can choose from the following conditions: From, To, Subject, keywords (Has the words/Doesn’t have), Size, and whether the email has an attachment.
- Visit Gmail on the web and sign in.
- Click the gear icon in Gmail and select See all settings.
- Go to the Filters and Blocked Addresses tab.
- Click Create a new filter.
- In the filter form, enter your filter criteria.
- Click Create filter at the bottom.
- On the next screen, check the box Delete it.
- Check Also apply filter to matching conversations to delete existing matching emails.
- Click Create filter to save your rule.




⚠️ Unlike searching for emails in Gmail, the criteria available for filters lacks the Date within option.


How to automatically delete emails in Gmail after x days
⚠️ Problem: I want to auto delete Gmail emails after time (several days / weeks / months).
❌ Gmail does not offer a built-in option to automatically delete emails after they become older than a certain number of days. Filters only apply to new incoming emails, and the "Date within" option is available for search — not for filters.
✅ Solution: You can manually delete old emails using Gmail search with the older_than operator, or automate the process with external tools.
1. Manual cleanup using search
You can search for old emails using operators like:
- older_than:30d → emails older than 30 days
- older_than:6m → emails older than 6 months
- older_than:1y → emails older than 1 year
After running the search, select the results and delete them manually. Unfortunately, you cannot set a Gmail rule to delete old mail or automate this process using Gmail’s native features.


⚠️ Many users mistakenly think that from now on, Gmail will delete emails older than the timeframe you selected. Don’t fall for this! The "Also apply filter to matching conversations" option deletes existing old emails once — it does not continue deleting emails automatically as they age.
2. Automate with Clean Email
Since Gmail can’t auto delete emails older than several days or months, you’ll need to use an external tool like Clean Email to automate the process and avoid manual cleanup.
Clean Email supports automatic deletion of emails older than X days or weeks, based on your chosen criteria.
Here’s how to automatically delete old emails in Gmail by setting up Auto Clean rules in Clean Email:
- Log in to Clean Email and connect your Gmail account, or download the app for iOS or Android.
- Go to the Auto Clean section.
- Click the ✚ sign on top or the Create rule button.
- Choose Trash (to send emails to the Trash folder) or Delete (to delete permanently, skipping the Trash) as the action.
- Choose Old Mail and set your desired age of emails (older than X days, weeks, months, or years).
- Additionally, you can set other parameters such as size of emails, read or unread status, choose specific senders, labels, keywords, and more.
- Click Create Rule to save, and Clean Email will now automatically delete matching emails continuously.


This way, your Gmail inbox stays clean without manual effort, and you can easily customize the automation to fit your needs.
3. Automate with Google Apps Script (for advanced users)
If you’re comfortable with coding, you can set up a simple Google Apps Script to automatically delete emails older than X days. This method requires some setup but can run on a schedule to continuously clean up your inbox.
Here’s the basic process:
- Open Google Apps Script.
- Create a new project and paste the following script:
- Save the project (give it a clear name, e.g. Auto Delete Old Emails).
- In the Apps Script editor, click the Triggers icon (clock) on the left.
- Click + Add Trigger in the lower right corner.
- For Choose which function to run, select autoDeleteOldEmails.
- Under Select event source, choose Time-driven.
- Under Select type of time-based trigger, pick Day timer.
- Choose your preferred time of day for the script to run.
- Click Save and authorize the script when prompted.
function autoDeleteOldEmails() { var threads = GmailApp.search('older_than:30d'); // change 30d to your desired timeframe for (var i = 0; i < threads.length; i++) { threads[i].moveToTrash(); } }
⚠️ This method requires basic scripting knowledge and careful testing to avoid unintended deletions. If you prefer an easier, no-code solution with more flexibility, Clean Email is the safer option for most users.
How to auto delete spam in Gmail
⚠️ Problem: I receive too many spam emails and would like to delete them automatically.
✅ Solution: Gmail automatically deletes emails in the Spam folder after 30 days. But to speed up the process, you can create a filter to delete certain types of unwanted emails as they arrive.
To do this, you can follow the same steps as described above to create a Gmail filter — but adjust your filter criteria to match typical spam emails:
- From: enter the addresses of domains you don’t trust
- Subject: common spam phrases like "You won", "Act now", "Limited time deal", "Urgent response needed", etc.
- Has the words: "Earn money fast", "Risk-free", "No credit check", "Click here", "Work from home", "Crypto investment", "Weight loss miracle"
Then, in Step 6, be sure to select Delete it to automatically remove these emails. This way, Gmail will delete spam-like messages before they appear in your inbox or Spam.
⚠️ Important: You cannot create a filter that targets Gmail’s Spam folder itself — but this method prevents unwanted emails from reaching it in the first place.
Auto-delete emails with keywords in Gmail
You may have other types of emails in Gmail that are consuming space that you’d like to automatically delete. These could be promotional emails like limited-time deals from shopping sites or post notifications from social media networks.
You might not want to completely unsubscribe from messages from these senders, but instead, delete certain emails you receive from them.
To set up auto-delete in Gmail based on keywords, follow these steps:
- Follow Steps 1 through 4 above to open the Settings and choose Create a new filter.
- Use the available fields to enter the criteria. Here are a couple of examples:
- To delete emails from any sender with “limited-time” in the email body, you’d use just Has the words: Limited-Time.
- To delete emails from Twitter with “tweeted” in the subject, you’d use both of the fields From: Twitter and Subject: Tweeted.
- Select Create filter.
- Check the box for Delete it.
- Optionally check the box for Also apply filter to matching messages to delete existing messages in your inbox that match the criteria. If you prefer to start the filter moving forward and not delete existing matching messages, leave the box empty.
- Select Create filter to apply and run the filter.
Moving forward, Gmail will automatically delete new incoming emails that match your conditions.
If you want to edit or delete a Gmail filter, return to See all settings → Filters and Blocked Addresses. Note that you cannot turn off a filter temporarily. To pause a filter, you must delete it and then follow the above steps to set it up again when you’re ready.


📌 Read more: How to delete all promotions in Gmail manually and automatically.
Auto-delete emails in the Gmail mobile app
Are you an on-the-go Gmail user? Unfortunately, you cannot currently create filters in the Gmail mobile app.
As an alternative, you can use the Clean Email app for iOS or Android on your mobile device. This allows you to set up Auto Clean rules for Gmail like those above ⬆️, and more, which we’ll describe below.
✅ Clean Email mobile app gives you more flexibility than Gmail’s built-in filters. You can create rules based on email age, size, labels, read/unread status, and more — all from your phone.
✅ The app also supports bulk actions and quick cleanups, so you can easily manage your inbox on the go. And unlike Gmail’s filters, Clean Email’s Auto Clean rules work continuously in the background, ensuring your mailbox stays clean without manual effort.
You can see all the rules you create in the Auto Clean section of Clean Email and pause a rule anytime you wish. Yes, unlike Gmail, Clean Email lets you temporarily stop a rule without deleting it which is a handy feature. ➡️Try Clean Email for Free
How to stop Gmail from deleting emails automatically
By default, Gmail does not automatically delete emails — except for messages in Spam and Trash, which are permanently deleted after 30 days.
If you notice other emails being deleted, check for:
- Filters you or someone else may have created with the Delete it action.
- Third-party apps connected to your Gmail that may be deleting emails.
- Forwarding rules or scripts that move emails to Trash.
To stop Gmail from deleting emails automatically:
- Go to Settings → Filters and Blocked Addresses tab → delete or edit any filter with Delete it selected.
- Check connected apps in your Google account settings and remove any you do not trust.
Keep Your Inbox Clutter-Free With Clean Email
Along with the Auto Clean feature for deleting Gmail messages in bulk, Clean Email gives you an advanced set of features for doing more to automate email tasks and keep your inbox neat and tidy.
Unsubscriber: To avoid the need to delete emails you no longer need such as promotional messages; an alternative is to unsubscribe from them. While Gmail gives you an Unsubscribe button to remove yourself from mailing lists, Clean Emails lets you unsubscribe from multiple emails at once and resubscribe later if you change your mind.


Cleaning Suggestions: If you struggle to find the best ways to clean up your mailbox, the Cleaning Suggestions offered by Clean Email may be just what you need. You’ll see recommendations for messages you can mark as spam, archive, or move to the trash. Not only that, but you can use the suggestions to act on groups of emails at one time.


Screener: Ever wonder how your email address got on a sender’s mailing list in the first place? With Clean Email’s Screener, you can view messages from new senders all in one spot. Then, either allow the email, block it, or unsubscribe immediately.


All Clean Email features are available both on the web and in the mobile apps for Android and iOS. So, no matter where you choose to manage your messages, you can enjoy simple, safe, and secure inbox management with Clean Email. ➡️Try Clean Email for Free
Don’t Let Unwanted Emails Ruin Your Inbox!
When Gmail launched in 2004, the email service offered one gigabyte of storage space for free. Today, Gmail users get to enjoy 15 GB of free storage, but that’s still not enough for some. Why? Because spam messages account for around 45 percent of all email traffic.
Indeed, it doesn’t take much time for spam messages to accumulate and eat up gigabytes of valuable storage space, leaving little room for messages that are actually important. Sure, you could purchase additional storage space from Google and call it a day, but that would be akin to throwing in the towel and letting spammers win.
Instead, you should learn how to automate email management using the solutions described in this article so that you can enjoy a clean, organized inbox without wasting hours of your precious time.
Wrap-Up
Now that you know how to auto-delete old emails in Gmail or those based on keywords, you can save a ton of time. Because Clean Email offers this same automation with even more flexibility, you can not only get rid of unwanted messages in a snap but do it on both your laptop and mobile phone.
📌 Ready to step it up a notch? Look at our guides for how to automatically move emails to a folder and how to auto-delete spam in Gmail.
How to Auto-Delete Emails in Gmail - FAQs
Can you set Gmail to auto-delete?
Yes, it can be configured to auto-delete emails that meet certain criteria using its filters. Alternatively, you can achieve the same result but more easily using a third-party inbox cleaner, such as Clean Email.
How do I automatically delete emails in Gmail to free up space?
You can delete large emails using Gmail search (larger:10M, for example) or delete old emails with older_than:X. For continuous cleanup and automation, you can use Clean Email’s Auto Clean rules.
Can I automatically delete old emails in Gmail without using third-party tools?
You can use Gmail search with the older_than:X operator to manually delete old emails. However, Gmail does not support automatic deletion of emails as they age — this requires an external tool or script.
How do I automatically delete large emails in Gmail?
Use Gmail filters or search with the Size criteria (larger:XMB) to find large emails. You can set a filter to automatically delete new large emails, or use Clean Email to delete both existing and incoming large emails.
Why is Gmail automatically deleting emails?
Does Gmail auto-delete old emails on its own? It does, but only those that it considers to be spam. If you want Gmail to automatically delete promotions and other types of email messages as well, then you need to manually create corresponding email filters.
How do I turn off auto-delete in Gmail?
To turn off auto-delete in Gmail, go to your Gmail settings, then find the section related to "Filters and Blocked Addresses" or a similar category. Here, you can edit or remove any existing filters that might be set to automatically delete emails.
How do I stop Gmail from deleting old emails?
Gmail only auto-deletes emails in Trash and Spam after 30 days. If other emails are being deleted, check your filters and connected apps — you can turn off any filter with the Delete action in Gmail Settings → Filters and Blocked Addresses.