I have a few search filters set up and I found a few posts that shouldn't be in the search results. On looking into it further I found these posts match 'part' of the keyword.

For example, searching for 'car' would match posts with 'carried', 'carbon', 'scar' and anything else with car in the word. I really want this to only pull posts that match 'car' exactly.

Is this how wordpress works by default? I've already tried the 'exact' => true argument on WP_Query but that makes the search horribly specific when using category filters etc.

How can I set it so it matches keywords exactly?

1 Answer 1


You might want to append the query parameter sentence=1 in your search, it is not well documented, but it should retrieve content inside the post that matches exactly the sentence pattern.

Alternatively, for a more powerful search, you might want to give a look at Relevanssi plugin. A lot of people agree that Wordpress search engine is… lacking, to say the least.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.