Core WP Sitemap Product XML files Error
-
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)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Core WP Sitemap Product XML files Error’ is closed to new replies.