aioseo_sitemap_exclude_terms

Purpose

This filter can be used to filter the terms that are excluded from the sitemap.

Arguments (1)

  1. $ids (array) – The IDs of the excluded terms.
  2. $type (string) – The type of sitemap.

Example code snippet

The code snippet below is just an example of how this filter can be used. In the example below, the term with ID 412 is excluded from the XML Sitemap.

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;
}