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

searchwp_pre_set_post

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.

<?php
// 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

Parameters

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