How to Change the Order of Your Gmail Filters

by Michael on February 16, 2010 · 16 comments

Wow. Just minutes after expressing my frustrations about being unable to control the order of Gmail filters, I figured out a simple workaround. As it turns out, Gmail Labs has a “Filter import/export” function that makes it all possible.

For context, e-mail filters can be a great tool for sorting incoming messages. The good news for Gmail users is that Google introduced filters (via Gmail Labs) awhile back, and last summer they took the filtering functionality out of beta.

Unfortunately, there’s no way to control the order in which your filters are applied. Rather, they appear in the list in the order in which they were created. If you’re an e-mail filtering ninja, however, you’re likely aware that the order in which filters are applied often matters.

Until now, the only solution I could come up with was to delete and re-create filters whenever I created a new filter that needed to be higher up in the list. But now there is a better way…

Changing the order of your Gmail filters

This isn’t a pretty solution, but it’s quite easy to implement. Start by going into Gmail Labs (Settings/Labs or click the little green beaker in the top right corner of the Gmail page) and enabling the “Filter import/export” functionality. Be sure to save your changes.

Now when you view your filters (Settings/Filters), there will be a checkbox off to the left of each filter. Simply do the following:

  1. Check the box for all of your filters (or click the “All” link at the bottom)
  2. Scroll down to the “Export” button (which is greyed out unless filter are selected)
  3. Click the button and you’ll be able to save a file called mailFilters.xml

Now simply open up that file in your favorite text or xml editor and modify it to your heart’s content. The filters themselves are wrapped in “entry” tags, like this:

blah blah blah (including category, title, id, updated, etc. fields)

Just move those blocks around to change the order of the filters.

The last step is to re-import your filters.

  1. Delete your old filters by checking the box next to each and clicking the “Delete” button (next to “Export“)
  2. Click the “Import filters” link at the very bottom of the filters page
  3. Click the “Choose File” button, and select your modified mailFilters.xml file
  4. Click “Open file” and you’ll be presented with a list of filters to import
  5. Make sure all of the checkboxes are checked and then click “Create filters

Note that this same procedure work for Google Apps.

{ 16 comments… read them below or add one }