• Resolved one3rdnerd

    (@one3rdnerd)


    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)
  • Thread Starter one3rdnerd

    (@one3rdnerd)

    Update

    When I use a plugin like Pods, to see all post types and taxonomies snax_collections doesn’t even appear under either.

    So maybe it’s not a post type or a taxonomy.

    In which case

    a) Why is Yoast creating a sitemap for it?

    b) How can we exclude it completely?

    The Snax plugin devs are completely unresponsive and after messaging them for the last 9 months, I haven’t heard back.

    The client needs this plugin for some functionality but I don’t understand why Yoast is creating this XML sitemap.

    Please advise.

    Plugin Support Maybellyne

    (@maybellyne)

    Hello @one3rdnerd,

    Thanks for using the Yoast SEO plugin. The plugin will create an XML sitemap for any content type that is public?and contains valid members. I see you have created a 301 redirect to the homepage. I am not familiar with the plugin responsible for the content type. Can you share a link to it in the plugin repository so I can test it?

    Thread Starter one3rdnerd

    (@one3rdnerd)

    Hi @maybellyn,

    Yes but

    a) It doesn’t seem to exist as a post type or taxonomy, so what else could it be?

    b) It doesn’t show as an option to turn on or off under Yoast’s settings for whether it should be indexed or no indexed.

    So it’s as though Yoast doesn’t detect it on the back end yet it’s creating a sitemap for it on the front end.

    The plugin isn’t on the plugin repository but you can download a copy from https://we.tl/t-4kDQh2YpTZ

    Thanks

    Thread Starter one3rdnerd

    (@one3rdnerd)

    I found the issue.

    This content type was being registered and then deregistered. I removed the deregistered part and then I was able to hide them in Yoast.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Issue removing sub sitemap that doesn’t exist’ is closed to new replies.