• Hello,
    In the post here you have listed a solution for excluding spesific taxonomies in cpt.
    If I want to exclude some taxonomies what should I do?
    Write down all the code several times? It does not work.
    I would love a solution, thanks

    • This topic was modified 4 years, 7 months ago by motilifshitz.
Viewing 1 replies (of 1 total)
  • Plugin Author Mikko Saari

    (@msaari)

    For multiple terms, do it like this:

    add_filter( 'relevanssi_do_not_index', 'rlv_index_filter', 10, 2 );
    function rlv_index_filter( $block, $post_id ) {
    	if ( has_term( array( 'TERM_NAME', 'ANOTHER_TERM_NAME', 'THIRD_TERM_NAME' ), 'TAXONOMY_NAME', $post_id ) ) {
    		$block = true;
    	}
    	return $block;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Regarding taxonomic exclusion’ is closed to new replies.