• Hi, checked both Post and Page and there is no issue with indexing (I supposed). But when I search, it does not show any Pages, only Post. How do I check if Pages are indexed too? Thanks

    *update: when I entered the following ?s=privacy&post_types=page it does show the search result for privacy policy page but when I entered the keyword “privacy policy” or “privacy” in the search box, there is no result.

    • This topic was modified 6 years, 6 months ago by Quan88.
Viewing 1 replies (of 1 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Your theme is restricting the search to the post type. Relevanssi is indexing pages fine, but your theme says “just show posts”.

    If you can’t fix this from your theme (there’s likely a hidden input field in your search form that adds the restriction) and you want to override it, you can add this to your theme functions.php:

    add_filter( 'relevanssi_modify_wp_query', 'rlv_force_post_types' );
    function rlv_force_post_types( $query ) {
        $query->query_vars['post_types'] = 'post,page';
        return $query;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Only able to search Post but no Page’ is closed to new replies.