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


View Parameters »

Note: Use of this hook will require a manual reindex

When a taxonomy has been added to an engine configuration, SearchWP will retrieve all taxonomy terms for that taxonomy when indexing a post. You can use this hook to modify the taxonomy terms for the post being index once they have been retrieved:

// Modify taxonomy terms for posts during SearchWP indexing.
add_filter( 'searchwp_indexer_taxonomy_terms', function( $terms, $taxonomy, $post_being_indexed ) {
// TODO: modify $terms in any way you'd like.
return $terms;
}, 20, 3 );
view raw functions.php hosted with ❤ by GitHub


Parameter Type Description
$terms Array

Taxonomy terms for this post

$taxonomy String

Taxonomy of these terms

$post_being_indexed Object

Post 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