By default, the official WordPress Jetpack plugin doesn’t support Woocommerce sites when it comes to generating sitemaps. It totally leaves out woocommerce product pages and only adds regular pages and posts.
Below is how I was able to get the sitemap to start including products on my sister’s woocommerce site.
If you know how to mess around with wordpress code, simply copy and paste the code below into your functions.php or wherever you add extra wordpress code, save and you’re good to go.
add_filter( 'jetpack_sitemap_post_types', 'htdat_jetpack_sitemap_post_types' );
function htdat_jetpack_sitemap_post_types( $post_types ) {
$post_types[] = 'product';
return $post_types;
}
If you don’t know how to mess with code, do please follow this guide to deploy the code on your website >> Add PHP Code Without Editing Files.
The changes to the sitemap won’t be reflected immediately but eventually they will.
You can try adding a new product or post or page to your woocommerce site, to trigger Jetpack into regenerating the new sitemap faster.
That’s all. Hope this helps
H/T: apply_filters ( ‘jetpack_sitemap_post_types’ )
Please Rate This Post:You’ll also like:
- How To Bulk Edit WooCommerce Variable Product Prices For Free
- Fixed: A Description for this result is not available because of this site’s robots.txt error
- How To Add Jetpack Related Posts To Google AMP Pages
- How To Install Disqus Comments On WordPress AMP Pages
- How To Add Google Adsense For Search Bar To AMP Pages
Please share this article to help others. Thanks