Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I've been using Filters for a while in Gmail but have always been wondering if such a feature is available. Is it possible to somehow have a Gmail filter apply more than one label?

As you can see below, the filter setup page only allows choosing one label:

alt text

If it turns out that it is impossible to specify more than one label, I guess I'll just have to create duplicate filters.

share|improve this question

2 Answers 2

up vote 9 down vote accepted

No, there is no way to do this.

But, you can use the Google Labs project Filter import/export under Settings > Labs in Gmail.

  1. Install Filter import/export in Labs
  2. Create your filter
  3. Go to Settings > Filters
  4. Check the checkbox next to your new filter
  5. Click "export" at the bottom, this will create an xml file called mailFilters.xml
  6. You should have a file that looks like this:


<?xml version='1.0' encoding='UTF-8'?>`
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
    <title>Mail Filters</title>
    <id>tag:mail.google.com,2008:filters:11344473557977</id>
    <updated>2010-07-14T20:24:10Z</updated>
    <author>
        <name>John Smith</name>
        <email>test@gmail.com</email>
    </author>
    <entry>
        <category term='filter'></category>
        <title>Mail Filter</title>
        <id>tag:mail.google.com,2008:filter:1131773557977</id>
        <updated>2010-07-14T20:24:10Z</updated>
        <content></content>
        <apps:property name='from' value='foo@example.com'/>
        <apps:property name='label' value='the_label'/>
    </entry>
</feed>

All you need to do is to carefully edit this XML file in an editor which can intelligently handle plaintext.

Copy the code from <entry> and paste it in immediately after the first one. I removed the <id> and <updated> sections and they still worked, so much of the stuff in there is optional. Copy and paste a few more times, and you've got the result you want.

This worked for me:

<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
    <title>Mail Filters</title>
    <id>tag:mail.google.com,2008:filters:11344473557977</id>
    <updated>2010-07-14T20:24:10Z</updated>
    <author>
        <name>John Smith</name>
        <email>test@gmail.com</email>
    </author>
    <entry>
        <category term='filter'></category>
        <title>Mail Filter</title>
        <id>tag:mail.google.com,2008:filter:1131773557977</id>
        <updated>2010-07-14T20:24:10Z</updated>
        <content></content>
        <apps:property name='from' value='foo@example.com'/>
        <apps:property name='label' value='the_label'/>
    </entry>
    <entry>
        <category term='filter'></category>
        <title>Mail Filter</title>
        <content></content>
        <apps:property name='from' value='bar@example.com'/>
        <apps:property name='label' value='another_label'/>
    </entry>
</feed>

Save your file then use the Import tool on the same Settings > Filters page and you will have the option of which of the contained filters you want to add.

share|improve this answer
    
Isn't this just a long way round to make a new filter? –  x3ja Jul 15 '10 at 3:09
2  
It's the long way round to making 2 or more filters with the same rule that apply different labels. A shortcut because you can't do what the OP asked. –  artlung Jul 15 '10 at 9:01
2  
Excellent - I have about 200 filters which apply labels, and I wanted to edit them all to add an additional label, and there's no way I was going to create another 200. Now I can just write something (maybe just an emacs macro) to duplicate the existing ones and add the new label. Thanks! –  Jer Jan 8 '13 at 15:17
    
@Jer glad this 2-1/2 year old post could help! If you end up writing any tools to facilitate this or have other tips feel free to edit my question or add your findings as a comment here! –  artlung Jan 8 '13 at 19:17

According to this Google Groups post, it is not possible:

Unfortunately, a filter can only apply a single label. If you want to apply more than one you need to create more than one filter, with the same search criteria.

share|improve this answer

Your Answer

 
discard

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.