This Documentation is for SearchWP Version 3

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