Home / Admin / Remove Specific Taxonomy From Public Taxonomies List
Duplicate Snippet

Embed Snippet on Your Site

Remove Specific Taxonomy From Public Taxonomies List

This filter can be used to remove the 'genre' taxonomy from the public taxonomies list.

<10
Code Preview
php
<?php
add_filter( 'aioseo_public_taxonomies', 'aioseo_filter_public_taxonomies' );
function aioseo_filter_public_taxonomies( $taxonomies ) {
	$filteredTaxonomies = [];
	foreach ( $taxonomies as $taxonomiesObject ) {
		if ( 'genre' === $taxonomiesObject['name'] ) {
			continue;
		}
		$filteredTaxonomies[] = $taxonomiesObject;
	}
	return $filteredTaxonomies;
}

Comments

Add a Comment