…included in the search results. So, here’s a two-part function that fixes that. First, we need a filter that processes the search results and gets a list of categories in the results. This filter runs very late on the relevanssi_hits_filter hook, so that it runs after other filters on the……same hook: add_filter( ‘relevanssi_hits_filter’, ‘rlv_gather_categories’, 99 ); function rlv_gather_categories( $hits ) { global $rlv_categories_present; $rlv_categories_present = array(); foreach ( $hits[0] as $hit ) { $terms = get_the_terms( $hit->ID, ‘category’ ); if ( is_array( $terms ) ) { foreach ( $terms as $term ) { $rlv_categories_present[ $term->term_id ] = $term->name; }……in place, there’s instead a link that removes all category filters. function rlv_category_dropdown() { global $rlv_categories_present, $wp_query; if ( ! empty( $wp_query->query_vars[‘cat’] ) ) { $url = esc_url( remove_query_arg( ‘cat’ ) ); echo “<p><a href=’$url’>Remove category filter</a>.</p>”; } else { $select = “<select id=’rlv_cat’ name=’rlv_cat’><option value=”>Choose a category</option>”; foreach (…