Hi @therock2018 ,
Yes, you can to exclude taxonomies and terms from the XML sitemap. To exclude taxonomies, please add the following snippet to your theme’s functions.php file:
add_filter( 'slim_seo_sitemap_taxonomies', function( $taxonomies ) {
$taxonomies = array_diff( $taxonomies, ['your_taxonomy'] );
return $taxonomies;
} );
If you want to remove all taxonomies, please use this snippet:
add_filter( 'slim_seo_sitemap_taxonomies', '__return_empty_array' );
To exclude some terms, you can change the term query as follows:
add_filter( 'slim_seo_taxonomy_query_args', function( $query_args ) {
$query_args['exclude'] = '12,34';
} );
Hi, thanks a lot for your reply.
Listen, I am probably much more stupid than I think!.
I tried different combinations without to fix it
The plugin show this list
mydomain/sitemap-post-type-post.xml
mydomain/sitemap-post-type-page.xml
mydomain/sitemap-post-type-erm_menu.xml
mydomain/sitemap-taxonomy-category.xml
I just need this one: mydomain/sitemap-post-type-post.xml
Some more tips?
Thanks and sorry for all.
Hi @therock2018 ,
We have filters for you to remove taxonomies sitemaps. In this case, if you want to keep only post, please use this snippet:
// Remove all taxonomies.
add_filter( 'slim_seo_sitemap_taxonomies', '__return_empty_array' );
add_filter( 'slim_seo_sitemap_post_types', function() {
return ['post'];
} );
Hi Anh,
Works like a charm!
Thanks a lot, for all.