Support » Plugins and Hacks » Relevanssi - A Better Search » [Resolved] Strict tag filter, possible?
3 years, 9 months ago
I created a small external popup with custom menu to search via tags.
The url looks like this
My question is:
Lets say I have two posts in the same category that share 1 tag, but not others.
Post one tags:
Cool, stuff, amazing, five
Post two tags:
Cool, sweet, awesome, seven
Now two post share one tag, but I don’t want them to show up in the results unless all other search tags match.
So since post TWO did not have “sweet, amazing, five” it should not show up when I search for “Cool, stuff, amazing, five”
I don’t know if I am being clear lol I am horrible at trying to explain things.
I basically want the tags to be very strict. If ALL off my tags that I am searching for do not have a result then I don’t want other posts to show up that have one or two other tags.
I toyed with the options but no clue how to set this up 🙁
Kinda like here:
When you pick MATCH ALL OF THE CHECKBOXES it will ONLY show results from the exact tag match.
Use the taxonomy query feature of WordPress, and you can define the tags any way you wish.
Also, in WordPress, listing tags with commas like “a,b,c” means a OR b OR c, but if you list the tags with plus signs (“a+b+c”), it means a AND b AND c, which is what you’re after.
So, just use ?tag=tag1+tag2+tag3.
This is explained in the WP_Query documentation and Relevanssi supports the WP default implementation.