Issue removing sub sitemap that doesn’t exist
-
Our website includes a sitemap full of 404 errors
https://eatheremedia.com/snax_collection-sitemap.xml
I have tried using filters to remove this but this hasn’t worked.
This doesn’t show under Yoast’s settings as an option for us to remove.
Can we remove it by targeting the URL?
Below is the code I have tried
add_filter( 'wpseo_sitemap_post_type_archive_link', 'my_wpseo_cpt_archive_link', 10, 2); function my_wpseo_cpt_archive_link( $link, $post_type ) { // Disable product/post archives in the sitemaps if ( $post_type === 'snax_collection' ) return false; return $link; } function sitemap_exclude_taxonomy( $excluded, $taxonomy ) { return $taxonomy === 'snax_collection'; } add_filter( 'wpseo_sitemap_exclude_taxonomy', 'sitemap_exclude_taxonomy', 10, 2 );
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Issue removing sub sitemap that doesn’t exist’ is closed to new replies.