Note: You are viewing the documentation for Version 3View Version 4 Docs

Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP's many hooks, get support

Available since: 1.0

searchwp_force_wp_query

SearchWP works by hijacking WordPress native search. Even when doing that, WordPress will still execute it’s native search query under the hood unless we tell it not to. By default SearchWP disables this additional query because it is effectively replaced with SearchWP’s internal algorithm, so it is an extra database call that does not need to happen. If you find this problematic, you can tell SearchWP to allow WordPress to perform it’s original query.

Example: If you want to have WordPress perform it’s native search query in addition to SearchWP performing it’s internal query, add the following to your active theme’s functions.php:

<?php
add_filter( 'searchwp_force_wp_query', '__return_true' );
view raw gistfile1.php hosted with ❤ by GitHub
Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP