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.0


View Parameters »

During indexing, SearchWP retrieves the post object for everything that gets indexed. If you would like to manipulate the post object before it is indexed (e.g. change post content, the title, post metadata, etc.) you can use this hook by adding something like the following to your theme’s functions.php:

function my_searchwp_set_post( $the_post ) {
// manipulate $the_post in any way you'd like
return $the_post;
add_filter( 'searchwp_set_post', 'my_searchwp_set_post' );
view raw gistfile1.php hosted with ❤ by GitHub


Parameter Type Description
$the_post Object

The post object 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