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

searchwp_indexer_taxonomy_term_index_slug

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:

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

Parameters

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

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