FacetWP – only index certain facets

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

add_filter( ‘facetwp_indexer_post_facet’, function( $return, $params ) {
$included_facets = array( ‘categories’, ‘price’ );
if ( in_array( $params[‘facet’][‘name’], $included_facets ) ) {
return $return;
}
return true; // skip indexing
}, 10, 2 );

{{/gist}}