• Resolved deandid

    (@lcm404)


    Launching a new site (can’t share the link here) where I am using WordPress core XML sitemap feature + WooCommerce (no Yoast or any other SEO plugin).

    All the posts, pages, and custom taxonomy sitemaps work. However, the actual sitemaps for the product pages just give me an “error” (in both Google Search Console and Big Webmaster Tools) and nothing else. I have no idea what’s going on and can’t really tell you anything more than Bing or Google doesn’t seem to like these sitemaps and it appears to be unique to WooCommerce. The files look identical and the only changes that I have made are with the following code:

    add_filter( 'wp_sitemaps_enabled', '__return_true' );
    
    /* remove users from sitemap*/
    add_filter(
        'wp_sitemaps_add_provider',
        function( $provider, $name ) {
            if ( 'users' === $name ) {
                return false;
            }
     
            return $provider;
        },
        10,
        2
    );
    
    /* exclude pages from sitemap */
    add_filter(
        'wp_sitemaps_post_types',
        function( $post_types ) {
            unset( $post_types['page'] );
            return $post_types;
        }
    );
    
    /* Remove static blocks from WP Sitemap */
    add_filter(
        'wp_sitemaps_post_types',
        function( $post_types ) {
            unset( $post_types['static_block'] );
            return $post_types;
        }
    );
    
    /* exclude posts from sitemap */
    add_filter(
        'wp_sitemaps_post_types',
        function( $post_types ) {
            unset( $post_types['post'] );
            return $post_types;
        }
    );

    Anyone else seeing this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there ??

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers!

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    We’ve not seen any activity on this thread for a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Core WP Sitemap Product XML files Error’ is closed to new replies.