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

There are tutorials that explain how to limit a search to a specific category.

My question is, is there a way to configure wordpress' search to, within a custom post type, search for a custom field value.

So for example, if I search for "hello", the results would come up with posts that have a certain custom field equal to "hello". The certain post would also be a certain custom post type.

Any help is appreciated.

share|improve this question
You can try building a custom search. – Rutwick Gangurde Aug 10 '11 at 6:42

Have you tried adding this hidden field to the search form?

<input type="hidden" name="post_type" value="news" /> 

For value="", you should include the name of your custom post type, of course.

share|improve this answer

Your Answer


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

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