SearchWP

This Documentation is for SearchWP Version 3

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.

[wpforms id="3080"]