Home / Admin / Exclude a Specific Term from the Sitemap
Duplicate Snippet

Embed Snippet on Your Site

Exclude a Specific Term from the Sitemap

This filter can be used to Exclude a Specific Term from the Sitemap.

Note: Replace 412 with the ID of the term you wish to exclude.

<10
Code Preview
php
<?php
add_filter( 'aioseo_sitemap_exclude_terms', 'aioseo_sitemap_filter_excluded_terms', 10, 2 );
function aioseo_sitemap_filter_excluded_terms( $ids, $type ) {
   if ( 'general' === $type ) {
      $ids[] = 412;
   }
   return $ids;
}

Comments

Add a Comment