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

My wordpress site doesnt search for pages' content. I have checked for the existence of the following filter that could prevent search from searching pages but there aint any


What else could I check for? Any help would be appreciated.

Regards, Loveleen

share|improve this question

migrated from stackoverflow.com Jan 12 '12 at 14:49

This question came from our site for professional and enthusiast programmers.

Depending on the theme, I'm not sure Wordpress searches across pages by default. Try this: wordpress.org/extend/plugins/search-everything – Paul Jan 12 '12 at 14:46

Try this:

function filter_search($query) {
    if ($query->is_search) {
    $query->set('post_type', array('post', 'page'));
    return $query;
add_filter('pre_get_posts', 'filter_search');
share|improve this answer

Your Answer


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