Software

Quick Tip: Archive old email in your Gmail inbox the easy way

No matter how hard you try, your Gmail is going to get bloated with old messages. Take advantage of Google's archive system to manage the clutter.

It is inevitable. Your inbox, whether it is Gmail, Outlook, or any other client, is going to fill up with old email. If you are like me, and I suspect that many of you are, you don't really archive email as you go. Instead you wait for a critical mass to build up and then you look to manage the problem.

The good thing about Gmail is that Google has a built-in archival system that you can take advantage of when you are ready. Of course, before you can archive you have to identify exactly which emails currently residing in your inbox qualify for the procedure. The simplest approach is to use the power of search - something Google is very good at non-coincidentally.

Search and identify

For this example, let's archive messages in my inbox more than 30 days old. Using some keyword searches we can get a list of email messages received before a specific date. In the search box at the top of your Gmail page type a search in this format:

before:yyyy/mm/dd

And, to further limit our search, specify that we are only searching the inbox:

in:inbox
The entire search string will look something like Figure A.

Figure A

in:inbox before:2012/01/01
Now that you have a list of results matching your search criteria, you can start the archive process. First check the Select All check box as shown in Figure B. That check box only accounts for the messages that manage to fit on the first page, so you have to click the link that says: Select all messages that match this search, to select all of the messages in the list.

Figure B

Click the Select All check box and the Select all messages that match this search link
Once you have made those two selections, all that is left to do is the archiving. For that you click the Archive button, shown in Figure C. When you click the button you will get a warning message, click OK to complete the process.

Figure C

Archive your inbox messages

You will now have less clutter in your Gmail inbox. If you ever want to find emails you have archived, they are now located under the All Mail label.

About

Mark Kaelin is a CBS Interactive Senior Editor for TechRepublic. He is the host for the Microsoft Windows and Office blog, the Google in the Enterprise blog, the Five Apps blog and the Big Data Analytics blog.

15 comments
udi
udi

From 1983 until two months ago, I never deleted an email. I've always had more than enough storage space and I've just archived the 260,000+ messages in the appropriate folders.


This year, I am going traveling and in the words of Lawrence Oates, I may be some time. I have decided to use GMail to fetch my mail from my slimmed down virtual servers via pop, and use it to manage my messages. Suddenly,  the 72GB of mbox (I still prefer this format) files, seems a little bit much, so while I have transferred most of the old stuff onto hard disks, I plan to adopt a more ruthless approach.  I already I use filters to add labels to most messages and I am now (shock horror) deleting stuff, but there are some things that the built in filters and controls won't do easily.

I found out that google apps has a scripting facility so now I have a couple of scripts running every night to delete messages with certain labels, when they reach a predetermined age.


I have a label called for sale for instance which is automatically applied to messages from certain companies. I know that these offers are usually good for a few weeks at the most so I automatically send them to the trash, 30 days after they arrive


DeleteforsaleAfter30() {

var delayDays = 30 // Enter # of days before messages are moved to trash

  var maxDate = new Date();

  maxDate.setDate(maxDate.getDate()-delayDays);

  var label = GmailApp.getUserLabelByName("for sale");

  var threads = label.getThreads();

  for (var i = 0; i < threads.length; i++) {

    if (threads[i].getLastMessageDate()<maxDate)

      {

        threads[i].moveToTrash();

      }

  }

}


coppied the script from someone else and changed the relevant bits, but unfortunately don't remember who posted it or where, so I can't give them the credit they deserve (sorry, if it's you). These work and make the task just a little easier. If I ever get round to looking into the APIs a bit more, I might even do something a little more sophisticated 

finfife
finfife

Update: The link appeared after I changed the "Display density" in Gmail settings.

finfife
finfife

When following the instruction in this post, the "Select all messages that match this search" link shown in figures B and C does not appear.  I'm guessing that Google dropped that feature in one of the UI updates since this was posted.

Does anyone know if the ability to select all the messages (as opposed to just one page of messages) is still there somewhere?  I really don't want to have to select-all and archive 2000 separate pages by hand.

Kieron Seymour-Howell
Kieron Seymour-Howell

I have searched and scratched my head, and apparently there is no setting to disable the archive feature of gMail. I like to keep online, or cloud services, CLEAR of data. I use only controllable backups, not uncontrollable ones.

margbb
margbb

I am constantly advised that every 30 days my older emails will be deleted. This does not happen. I have around 1200 emails in "Mail" and a few more in "All Mail". I clean (delete forever) my Trash daily. I am still in the learning process as far as using my computer is concerned. I wish there was a easier system for stream lining and deleting emails. Any comments or help would be appreciated. Archiving may not be the solution for me? Thanks for your time. TC.

Gisabun
Gisabun

A writer for a magazine last year had his Gmail account hacked into. Aside from sending out spam, the hackers ditched every message accumulated over the past 5+ years. Everything was gone. Googlre couldn't even properly restore what he did have. He then contacted a vP at Google [who happens to be a friend] and managed to get back all [?] of the lost mail. But for the average individual, good luck. What is suggested is to install a mail client on a computer and connect to your cloud mail provider [Gmail, Hotmail, etc.]. Configure the software NOT to delete the mail from the server after downloading it to the computer. Eh voila. An instant backup. Open the client mail software every once in a while to "backup" your mail.

LedLincoln
LedLincoln

Back in the day, I sorted my mail assiduously, had folders for every appropriate category, and kept my inbox cleaned out daily. Now, though, with the huge improvements in search, I don't see any point in taking the time to organize. I either keep mail or I don't. My gmail inbox has over 3000 messages. My Outlook inbox has 21000 items. Works for me.

alfred
alfred

Before the recent "improvements" in Google Mail I used to click oldest select all on the page with one click and then archive. One click then took me back to my most recent emails. No typing involved.

Mark W. Kaelin
Mark W. Kaelin

So how many messages are in your inbox right now? Do you need to do some archiving?

Onafetz
Onafetz

I think of myself as quite proficient in exchanging mails, however by using the Gmail account at work from June 2011 I just came out with 2,167 messages amounting to 6% of total space. I assume I don't need archiving for the time being. I do tend to delete useless mails on a daily basis though. By the way, archived mails would show in a global search once archived? If not how could I include them in such a search if in need to find an old important document? I mean, if I needed to archive then when unpacking the older mails I arguably wouldn't have enough space in the mailbox to hold everything and perform a global search anyway... How do i manage this?

ivilaboa
ivilaboa

Mark:I have 12 mails in inbox. I always label and archive any mail that doesn't need reading or replying. Onafetz: Archived mails are searchable. In fact, the inbox is just another label the mails could have. You can "move" to inbox anytime. Unless you wipe your trash, all mails take some space in your account.

Mark W. Kaelin
Mark W. Kaelin

Just search under the "All Mail" label - that is where your archived emails reside.

Editor's Picks