WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a them theme that is search-heavy, and my users are putting huge priority on an improved search function.

I think I will have to use a special direct query to search these things:

  1. Terms
  2. Title
  3. Content

And allow flexibility such as:

  1. Word fragments (search bread, finds wonderbread)
  2. Phrases (search Orange Man, returns post with man in title, orange in terms)

Without asking anyone to re-invent the wheel, I was wondering if any such direct query example existed that I can modify to the needs of my custom post type (and possibly taxonomy).

I have no doubt many have wondered the same thing in various projects.

share|improve this question
You start off talking about a theme, and then ask about a custom post type, which you haven't described. Regardless, this question is, at core, an SQL one. – vancoder Apr 16 '13 at 21:32
You could always go the route of an out-of-the-box solution, with a plugin I've had great results with this one: wordpress.org/extend/plugins/relevanssi – NW Tech Apr 22 '13 at 19:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.