Leave Chosen Categories Out of the AIOSEO Sitemap
Removes the category or tag archives you list (by term ID) from All in One SEO's sitemap.
Opens WPIDE on
Code
// Term IDs to leave out.
$wpide_aioseo_terms_exclude = array( 5, 9 );
add_filter( 'aioseo_sitemap_exclude_terms', function ( $ids, $type ) use ( $wpide_aioseo_terms_exclude ) {
return array_unique( array_merge( (array) $ids, array_map( 'intval', $wpide_aioseo_terms_exclude ) ) );
}, 10, 2 );
Notes
Find a term's ID in the edit link on Posts > Categories.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.