Available since: 2.8.7


View Parameters »

Note: Use of this hook will require a manual reindex

By default SearchWP indexes only the taxonomy term name when indexing taxonomies that have been added to any engine configuration. A common need is to also index the taxonomy term slug as well, which you can do by adding this to your theme’s functions.php:

// Tell SearchWP to index taxonomy term slugs alongside the taxonomy term name.
add_filter( 'searchwp_indexer_taxonomy_term_index_slug', '__return_true' );
view raw functions.php hosted with ❤ by GitHub


Parameter Type Description
$index_slug Boolean

Whether to index the term slug

$context Array

$context['SWP'] The SearchWP instance
$context['taxonomy'] The taxonomy being indexed
$context['term'] The term being indexed