# Exclude Taxonomies From the Yoast Sitemap

> Leaves taxonomy sitemaps, such as tags or a plugin's filter attributes, out of the Yoast SEO sitemap index.

- Type: PHP
- Runs: Frontend only
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: yoast, sitemap, taxonomies
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/yoast-sitemap-exclude-taxonomies/

## Code

```php
// Taxonomy names to leave out of the sitemap.
$wpide_sitemap_skip_tax = array( 'post_tag', 'post_format' );

add_filter( 'wpseo_sitemap_exclude_taxonomy', function ( $excluded, $taxonomy ) use ( $wpide_sitemap_skip_tax ) {
    return in_array( $taxonomy, $wpide_sitemap_skip_tax, true ) ? true : $excluded;
}, 10, 2 );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Exclude Taxonomies From the Yoast Sitemap" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
