Odstraní ze sitemapy kategorie specifikované v tax_query.
<?php
add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', function () {
$post_ids = get_posts(array(
'numberposts' => -1, // get all posts.
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => 14,
),
),
'fields' => 'ids', // Only get post IDs
));
return $post_ids;
});