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

Is there a code snippet I can add to my functions.php, etc., that will include comments in the search (without plugin)?

share|improve this question

Whether you put custom code in your theme's functions.php or in a plugin, you're still using custom code. So I'm going to ignore your "without a plugin" requirement and instead suggest these two plugins:

There is absolutely no reason to use custom functionality in functions.php rather than a plugin. When you're asking for such advanced/complex functionality as a global search, that requirement becomes a huge limitation and will prevent you from ever finding the answer you're looking for.

If you're still hung up on not using a plugin, you might want to offload the actual search to another engine like Google. In that case, this video tutorial on integrating a custom Google search might be useful.

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.