Add the ability to exclude categories.
I'm currently adding a Yoast SEO category indexing check, but you can add it separately, for example, like how you can currently exclude post types.
/src/Output/ContentRenderer.php
use WPSEO_Taxonomy_Meta;
private function format_taxonomy_terms(string $taxonomy, int $post_id): array {
$terms = get_the_terms($post_id, $taxonomy);
if (!$terms || is_wp_error($terms)) {
return [];
}
$lines = [];
foreach ($terms as $term) {
// Retrieve Yoast's explicit 'index' setting for this specific term
$index_setting = WPSEO_Taxonomy_Meta::get_term_meta($term->term_id, $taxonomy, 'noindex');
if ( $index_setting != 'noindex' ) {
$lines[] = ' - name: "' . $this->escape_yaml($term->name) . '"';
$lines[] = ' url: "' . $this->get_term_markdown_url($term) . '"';
}
}
return $lines;
}
Add the ability to exclude categories.
I'm currently adding a Yoast SEO category indexing check, but you can add it separately, for example, like how you can currently exclude post types.
/src/Output/ContentRenderer.php
use WPSEO_Taxonomy_Meta;