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: 2.5

searchwp_init

By default SearchWP will initialize itself on every page request. If you would like to prevent that from happening, add something like the following to your theme’s functions.php:

<?php
// prevent SearchWP from initializing itself unless it's a search page
function my_searchwp_init() {
return is_search();
}
add_filter( 'searchwp_init', 'my_searchwp_init' );
view raw gistfile1.php hosted with ❤ by GitHub

Note: SearchWP will always initialize itself when is_admin() is true.

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