How to Create a Gmail Filter with an “OR” or an “AND” Argument

If you find this useful please share it!


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 never goes to the spam folder.

You would first set up a filter to make sure that email from never goes to the spam folder.


how to set up or argument gmail filter

set up gmail filter or


Then you would set up a second filter to make sure that email to anybody at never went to the spam folder (for example if you are cc:ed on an email to a colleague at

how to create OR filter gmail

create or argument gmail filter


That’s a lot of duplicated effort for something that ought to be much easier.

We know you're sick of ads on websites. But we still need to pay to keep the lights on for you. So instead of huge ads and video ads, we use smaller, plainer ads. Still, if you'd like to support the Internet Patrol but not the ads, please consider supporting us here:
Donate via Paypal
Other Amount:

Most mail program filters allow an OR argument, so that you can say something like:

“For any email that is to OR from, never send it to spam.”

(Article continues below)
Get notified of new Internet Patrol articles for free!
Or Read Internet Patrol Articles Right in Your Inbox!
as Soon as They are Published! Only $1 a Month!

Imagine being able to read full articles right in your email, or on your phone, without ever having to click through to the website unless you want to! Just $1 a month and you can cancel at any time!
How to Create a Gmail Filter with an “OR” or an “AND” Argument

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 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:

“ OR”

how to create and or filter gmail

creating a OR AND gmail filter


Once you have it the way you want it, don’t forget to click on the ‘Create filter’ button!

how to make gmail filter and or


In addition to ‘to’ and ‘from’, you can build OR and AND filter arguments in that ‘Has the words’ section for:


…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:

not this:


And that’s how to include an OR or AND in your Gmail filters!

No Paywall Here!
The Internet Patrol is and always has been free. We don't hide our articles behind a paywall, or restrict the number of articles you can read in a month if you don't give us money. That said, it does cost us money to run the site, so if something you read here was helpful or useful, won't you consider donating something to help keep the Internet Patrol free? Thank you!

How to Create a Gmail Filter with an “OR” or an “AND” Argument

Get notified of new Internet Patrol articles!
People also searched for gmail filter or, google email filter with or, how to get your gmail filter to use or, how to write a filter for gmail

If you find this useful please share it!

Leave a Reply

Your email address will not be published. Required fields are marked *