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


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

Available since: 2.8.8


View Parameters »

When indexing, SearchWP creates a reference to each post as it is indexed. Using this hook you can modify any number of entries prior to getting indexed. This hook is run for each entry prior to it being indexed.

// Modify post(s) before SearchWP indexes them.
add_filter( 'searchwp_pre_set_post', function( $the_post ) {
// TODO: Modify $the_post in any way you see fit.
return $the_post;
} );
view raw functions.php hosted with ❤ by GitHub


Parameter Type Description
$the_post Object

Entry being indexed

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