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

how to set up or argument gmail filter
Share the knowledge

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.

[Website maintenance provided by Usestrict and we love them!]

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.

how to set up or argument gmail filter

set up gmail filter or

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.

CashApp us Square Cash app link

Venmo us Venmo link

Paypal us Paypal link

 

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).

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.

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”

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:

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.

CashApp us Square Cash app link

Venmo us Venmo link

Paypal us Paypal link

Get New Internet Patrol Articles by Email!


Share the knowledge

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

Leave a Reply

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.