aioseop sitemap exclude tax terms

Need help with this?
Purchase All in One SEO Pack Pro to get dedicated support from us.

Buy Now

The All in One SEO Pack aioseop_sitemap_exclude_tax_terms filter hook.


$args = apply_filters( 'aioseop_sitemap_exclude_tax_terms', $args );

This filter can be used to exclude (or include) taxonomy terms from the sitemap based on their ID.

Parameters (1)

0.$args (array)
contains both the taxonomy name and list of excluded IDs for that taxonomy.
Use the nested “taxonomy” array to target the taxonomy based on its name.
Use the nested “exclude” array to add/remove IDs of taxonomy terms that need to be excluded/included.


The example below shows ‘category’ as the name of the taxonomy, and ’32’ as the ID of the term:

add_filter( 'aioseop_sitemap_exclude_tax_terms', 'aioseop_sitemap_exclude_tax_terms', 10, 2 );

function aioseop_sitemap_exclude_tax_terms( $args ) {
	if ('category' === $args['taxonomy'][0]) {
		array_push( $args['exclude'], '32' );
	return $args;

Defined (1)

The filter is defined in the following location(s).


This filter hook was added in version 3.2 of All in One SEO Pack and All in One SEO Pack Pro.

For instructions on how to use this code, please refer to our FAQ here.

  • Was this helpful ?
  • YesNo