I’m having trouble with my custom theme’s search function. I have a number of posts with apostrophes in the title. For example, McDonald's
.
However, when I try searching say McDonalds
, the post won’t return in the search results.
How can I go about making sure that McDonald's
would return in the result even if the user didn’t include the apostrophe.
Your question isn’t much of a WordPress related question, more like a MySQL question.
But I have sort of a solution in my head:
You could go with a custom query and a replace on the apostrophe:
For a combined search:
It isn’t worlds most beautiful solution, but you could give it a shot.