If you use Gmail either as your primary email provider, or as a pass-thru account (for example, as an offsite spam filter through which you first run your email before forwarding it to your primary email account), then you have undoubtedly set up some filters and labels on Gmail. And, you may have been frustrated at trying to set up a filter to deal with certain communications, only to find that it seems you have to create a separate filter for every single instance.
For example, let’s say that you wanted to set up a Gmail filter to ensure that email either from or to people where you work at Acme.com never goes to the spam folder.
You would first set up a filter to make sure that email from acme.com never goes to the spam folder.
The Internet Patrol is completely free, and we don't subject you to ads or annoying video pop-ups. But it does cost us out of our pocket to keep the site going (going on 20 years now!) So your tips via CashApp, Venmo, or Paypal are VERY appreciated! Receipts will come from ISIPP.
Then you would set up a second filter to make sure that email to anybody at Acme.com never went to the spam folder (for example if you are cc:ed on an email to a colleague at Acme.com).
That’s a lot of duplicated effort for something that ought to be much easier.
Most mail program filters allow an OR argument, so that you can say something like:
“For any email that is to OR from acme.com, never send it to spam.”
So, one filter covers both things.
In fact, most mail programs also allow an AND argument, so you can create a filter such as:
“For email that is from acme.com AND has a subject of ‘important’ never send it to spam.”
And guess what, you can also do this in Gmail, but the ‘how’, while easy, is not obvious.
So here’s how.
How to Set Up a Filter in Gmail with an OR or AND Argument
The secret is to completely ignore both the ‘From’ and ‘To’ sections, and instead to build your search criteria within the ‘Has the words’ section.
So, in our example, in the ‘Has the words’ section, we would put:
“to:acme.com OR from:acme.com”
Once you have it the way you want it, don’t forget to click on the ‘Create filter’ button!
In addition to ‘to’ and ‘from’, you can build OR and AND filter arguments in that ‘Has the words’ section for:
subject:
cc:
label:
…and a host of others (you can read a full list here).
Always remember to not have any blank space between the colon and the search term, so this:
from:example@theinternetpatrol.com
not this:
from: example@theinternetpatrol.com
And that’s how to include an OR or AND in your Gmail filters!
The Internet Patrol is completely free, and we don't subject you to ads or annoying video pop-ups. But it does cost us out of our pocket to keep the site going (going on 20 years now!) So your tips via CashApp, Venmo, or Paypal are appreciated!
Receipts will come from ISIPP.
Very helpful, thanks!
We’re so glad that it was helpful! Thank you for letting us know!
Except…. you never showed how to create and “AND” filter
Good piece. Thank you.