I tend to create many filters in Gmail so that lots of types of email I receive daily doesn't interrupt me with new mail notifications, but instead gets assigned a certain label (kind of like how Gmail tried to do automatically, but I would like to have explicit control).
My typical workflow is that I open the email, select the option "Filter message like this one" and leave the auto populated items here (typically sender address or a mailing list name). Then on the next screen, I always select the same options (skip the inbox, apply label [label name is typically one of 2 I mostly use], and also apply to selected messages).
Is there a way to either batch create filter like these (i. e. select a bunch of email by some means, and apply this filter to any that match these senders), or to have some sort of filter template instead of having to check all those boxes each time?
Best Answer
Actually there is a way (I use it myself).
Go to your Gmail account -->
Settings
-->Filters and blocked addresses
.Find your "typical" filter from your existing list of filters and check it's box you find on the left side. (make sure you choose just one filter -at least till you get the hang of the process).
Now go to the bottom of the page and on the left hand side click the Export button. Download and save the created
mailFilters.xml
file.Make a copy of it (just to be on the safe side), rename it to whatever you want (eg:
mailFilters-XYZ.xml
). This file will be your template. Open your new template with a basic text editor.It will look something like this:
This particular file reads that: when new mail arrives and
As mentioned, you execute the previous steps only one time.
Open your template, change
Company XYZ
andClients/XYZ
to whatever you like and save the file.Go back to the bottom of your Gmail account -->
Settings
-->Filters and blocked addresses
and click on theImport filters
link.Choose file and Open file
Create filters. If you want check the
Apply new filters to existing email
box as well.Enjoy your new filters.
The beauty of this process is that once you understand it, you can download several -even different- filters in just one
mailFilters.xml
file, create a "multi-filter" template and change/import them all together or a choice of them."Is there any documentation on the format used in the XML file?"
You can use one of the online .xml viewers (Free Online XML Viewer & Formatter) to help you further analyze the file.
"I would like to use multiple words with AND or OR in the query"
What you need to look into is the Gmail Operators.
As an example, you could apply one filter to all emails from John or Bob or Jane by using