[HowTo] AND and OR filtering

Please don't report problems in replies to How To posts. They don't get noticed. If you want to report a bug, ask a question, or make a related [feature request](https://forums.plex.tv/c/general/feature-suggestions/8), please post it in the appropriate forum, where it will have the best chance of being seen. Replies to How-Tos should be in reference to the article itself (typos, clarifications, etc.).

Plex’s Custom Filters allow you to construct relatively complex rules combining more than one filter to find what you want in your libraries.

AND filter

If you add rows to the custom filter and select the same property in each (Collection, for ex.) row, the filter evaluates the rows as an AND filter.


This filter will find movies that are part of the OPB collection AND the ‘Robert Langdon’ collection.

OR filter

*Note: Rating filters (Track Rating, Album Rating, Artist Rating) can not be combined in an OR operation

Select multiple values on a single custom filter row by repeating the action:
While viewing the Custom Filter UI, click the Value field once and pick the first value. Then click the Value field again to pick the second (or third, etc.) value. These will be treated as an OR filter.


This filter will find movies that have either the genre Sci-Fi or Science Fiction.

For custom filters like Artist Genre, where the values are populated in a dropdown list from the genres that exist in your library, the filter options are “is/is not,” rather than the “contains, begins with, ends with” options that exist for free-form filters. In this case, you can still type into the value field. In the example below, you see “Celtic” and “Celtic New Age” genres in the unfiltered dropdown list. If you type “new” in the value field, the dropdown list will pare itself down to show all genres that include those letters anywhere in the genre name.

Unfiltered genre list:

Typing “new” in value field pares down the list to match:

This, coupled with the “is/is not” operators, allows you to replicate all of the functions (“contains,” “does not contain,” “is,” “is not,” “begins with,” “ends with”) that are available for filters with free-form values, such as Artist Title.

2 Likes

I’m a bit lost, where is this? All I see are the standard filters, genre, country and collection. When I select collection the only option i see “deselect all”.

1 Like

If your Plex Web is 3.0, when you drop down the Filter menu, at the bottom is a ‘Custom Filter’ item.

Hi, is this only available to Plex Pass users? I’m using Web viewer 3.1.1 and I only get the following:

(What’s even more annnoying is that the Genres available from this menu are not the highly nuanced ones which I’ve very carefully tagged my albums with, but some really generic ones which Plex is pulling from goodness knows where. But I guess that’s a story for another post …)

@hertfordkirks said:
Hi, is this only available to Plex Pass users? I’m using Web viewer 3.1.1 and I only get the following:

You need to be at least on Server version 1.4.3
If you are already using that, optimize your Plex database and restart Plex server.

As far as I know, the custom filter is available to all, but there are some reasons you might not have it:

  1. I think you need to run the “Optimize database” command before it will appear.

  2. If you’re using Plex Cloud Server, I don’t think the feature is implemented in Plex Cloud yet.

Thanks, will try that…

Brilliant this works, and I have access to the new filters interface, so thanks to @OttoKerner and @beckfield .

I still don’t have access to my ‘in-depth’ genres though. Maybe I could start another topic, it’d be really nice to have …

Cheers anyway.

@hertfordkirks said:
What’s even more annnoying is that the Genres available from this menu are not the highly nuanced ones which I’ve very carefully tagged my albums with, but some really generic ones which Plex is pulling from goodness knows where. But I guess that’s a story for another post …

If you’ve already tagged your files very carefully, you need to set a few Plex preferences differently and then re-import your files into Plex.
https://forums.plex.tv/discussion/comment/1050849/#Comment_1050849
https://forums.plex.tv/discussion/comment/1093611/#Comment_1093611

All follow-up question in a different thread, please.

Plex needs a “and” “or” option to filter with multiple criteria. For example, I can choose to filter using and/or within a single criteria (like Collection, Title, Rating, etc,), but not between multiple criteria like Collection AND Director.

This would be useful for making lists of, say, “all movies with Stephen King stories.” I can choose multiple Collections, but if I add “Stephen King” as director, I’m only shown movies with “Stephen King” as the Collection, AND Stephen King as the Director. If I had the option of choosing “OR” I would see movies that had King as the Collection OR Director. See below.

1 Like

What you are asking for is “Nested Rules” which is something that is on our radar and we would like to support.

No ETA on when that unfortunately.

I’ve found that the OR works for IS evaluations, but it does not work for IS NOT evaluations. It seems to run the OR’s completely independent thereby nullifying each other. My expectation is that if I say:

Album Genre is not “x” or “y”
That neither X nor Y albums would show in the list. However, they are both showing.

I would like to make multiple “or” selections for track rating in a custom filter. For example, I’d like to be able make a playlist that is all songs with a 2+ rating or no rating at all.

Use case:
If I’ve already rated a track as a 1-star, I probably don’t like it or want to hear it anymore. If there’s no rating, it might just be new. I would still like it to show up (at least until I give it a bad rating).

With other “text-field” filters, I can do “or” values. With the rating, I cannot. I tried a filter that just included all songs that match “is not” 1-star, but that appears to also filter out songs which have no ratings.

Anyone have any advice there?
-Neil

2 Likes

I think the Ratings filters (Artist, Album, or Track Ratings) are an exception to the OR function, so I think that should be a feature request. I tried "Track Rating is less than 1 AND Track Rating is greater than 1", but that didn’t work either.

The “Track Rating is not 1” issue is a bug that was reported a couple of years ago, but apparently hasn’t been fixed.

2 Likes

Hi. Thanks for the tips. I was close to open a new topics but this posts looks good to continue with my interrogation.
So, like a lot of users.l, I have a photos collection of my family with photos and videos of my holidays. before, it was possible to play randomly my picture on the screen in a auto repeat mode.

Now, this include photos AND video. How can I exclude all video format and only play photo ?

Thanks you.

I’m not aware of a way to do that, but you should start a new thread in the appropriate forum section (for the Plex app you’re using) for a better chance at getting attention.

That would be an AND NOT, not an OR. IIUYC, you want tracks where the album genre is not X and is not Y. No?

I would like to construct an OR filter that uses two fields, for example I want all tracks where Album Genre = “x” OR Artist Genre = “x”. As far as I can see, this can’t be done. Am I missing something?

1 Like

Sorry to not notice this for so long. I don’t keep tabs on this.

No, that can’t be done in the current design. The OR function only works within a particular field.

Might be a good feature request (there might already be one).

It was requested 2 years ago. As per usual, Plex staff tells us NOTHING. They just abandon topics all the time. It seems like a reasonable request to me. I want to filter movies that are Directed or Written by Alfred Hitchcock, not a subset.

1 Like