Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to delete certain Gmail messages older than n days (I can get the whole set though a search string). I know this is not possible directly within Gmail (see for instance this question) so I am looking for a webapp which could handle such activities on my account (and, generally, similar housekeeping tasks).

An automated solution that would actively mark messages as read when they reach a specified age is the desired solution. Is there a way to accomplish this through Gmail filters and some syntax? Are there any apps, scripts, etc. that would help?

share|improve this question
It might be possible to write a Greasemonkey script that would perform this action. – Anderson Green Jul 8 '12 at 19:58
I am also interested in accomplishing this. Help wanted. – Randy6T9 Jul 28 '12 at 5:36
up vote 0 down vote accepted
  1. There's no built-in feature in Gmail to do this as of writing this answer (Jan 2013).
  2. I had same issue with all these old newsletters and notifications and I have created Google app script to do exactly this, with some help from built-in filtres. Please check out here: http://2sdd.blogspot.ru/2012/11/how-to-clean-up-gmail-inbox-from-emails.html

Script is very simple, feel free to hack it to your own needs.

share|improve this answer
Thanks - also for the script which basically solves the issue (though in an indirect way, this is something which should really be implemented by Google). Updating "best answer" :) – WoJ Jan 9 '13 at 8:55

According to Google:

  • older_than, newer_than — Similar to older and newer, but allows relative dates using d, m, and y for day, month, and year
    Example: newer_than:2d
    Meaning: Finds messages sent within the last two days.

With this you can create a filter deleting these, and even only the mails in a specific label.


share|improve this answer
Thanks but this is not what I was looking for. I know that I can search for emails meeting certain criteria. What I want to do is to have an automated way to handle them (delete in that case), without manual actions from my side. – WoJ Jan 15 '13 at 13:28
@WoJ Filters are what you use to automatically delete messages meeting certain criteria. Is the problem that, even with the older_than: criteria, the messages only get actioned by the filter when entering your inbox, and so after that, the filter won't trigger when the messages become older than the given period? – Nathan Craike Jan 16 '13 at 1:10
@Nathan Craike: exactly. I have a bunch of filters which handle incoming mail but, as you mentionned, this is only for incoming mail, not the one in th einbox. – WoJ Jan 16 '13 at 7:43

Why not simple search, select and delete?

Example, you want to delete all mails before 1st January 2009. So you search Gmail for -


(You can search for anything and rest of this answer would still work)
That returns all the mails in inbox before 1st january 2009 -

enter image description here

Now you select all mails in the current page by ticking this box -

enter image description here

Google will select all mail on the page and also ask you if you want to select all the mails that matches your search query -

enter image description here

If you click Select all conversations that match this search, it'll select all the mails before 1st jan 2009, which are all the mails you want to delete.

You can then click the Delete button and it'll ask you if you are sure -

This action will affect all conversations in this search. Are you sure you want to continue?

Press Ok and your mails should be deleted.

share|improve this answer
Caution - if conversations are turned on, you will also delete any messages after that date if they are part of a conversation that occurs before the specified date. – mhoran_psprep May 11 '12 at 3:46
Thanks but this is not what I want to achieve. I know about the search options and what I am looking for is a way to match messages "older than 10 days" (for instance). Not "older than May 1st" (in the case of today). The typical usage would be to get rid of messages which make sens only for a given time, like TV listings. This needs to be a relative time measure, not a date-based one. – WoJ May 11 '12 at 6:56
Do you want to create a filter? If not, it's just a matter of one step to turn "10 days older" to "before 01-05-2012" which doesn't take more than a second. – Bibhas May 11 '12 at 6:59
Do you know how to create a Greasemonkey script that would perform this action automatically? – Anderson Green Jul 8 '12 at 20:01

If you have 10,000 emails sitting in google, deleting 8,000 of them 20 at a time is not a fun option. An easier option if you have a very large amount of email is to get a free email client such as Thunderbird and set it up to delete mail older than X number of days. If you want to keep mail longer than the limit in the email client, set it to delete from the server when deleted from the client. Then check the email with the client every so often to delete the email from the server.

share|improve this answer

No there is not, what I would suggest doing is something like Al Everett mentions on the question you linked to. You can have various links for the different tasks you want to perform.

It would be nice to have a way to delete email older then a few days automatically but as of right now you cannot.

share|improve this answer

You can also use this google script. The advantage would be that you can give nested labels too.

Google Apps Script; delete Gmail e-mails

To run, create a copy of the script, add in values for label and "N" days, do Run-> Initialize and then Run-> Install.

share|improve this answer
A similar answer has also been posted to Lifehacker – WoJ Feb 24 '13 at 15:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.