Plugin Support
Jerlyn
(@jerparx)
This concern has been reported here https://github.com/Yoast/wordpress-seo/issues/9540 and was already fixed. Can you please confirm if you are using the latest version of the plugin?
Yes, I have updated my site to the latest version and the cart – account – checkout pages are still listed in my sitemap.
The only way to remove them is by setting the page to noindex from the yoast seo bix but this will cause duplicate meta robots tag.
Please solve this.
Thank you
It’s fixed in Yoast WooCommerce SEO plugin (but not in Yoast SEO). Also, it’s related to WooCommerce plugin. You could read – https://github.com/woocommerce/woocommerce/issues/21297.
Since you already set noindex to these pages, then you could “unhook” WooCommerce function which adds robots tags (there isn’t other way):
remove_action( 'wp_head', 'wc_page_noindex' );
Second solution is using Yoast hook – wpseo_exclude_from_sitemap_by_post_ids
to exclude these pages from sitemap (and leave WooCommerce code to handle noindex).
I’ll think over about creating new issue on Github, but it isn’t only Yoast SEO issue.
I think I will use wpseo_exclude_from_sitemap_by_post_ids
but this should be fixed by default. I don’t know why the people responsible for this plugin insists on not fixing this issue but thank you for providing a solution.
this is not fixed as i got the sitemap error message today from google about my cart and checkout pages. using the latest version of wordpress, woocommerce, and Yoast
@stodorovic Can you give an example on either of those on excluding the cart and woo commerce my account page from sitemap? I have the free yoast seo plugin.
I think that the best solution is to manually set “Allow search engines to show this Page in search results?” to “No” (It should be compatible with WPML) for pages My Account, Cart, and Checkout. It will exclude these pages (and translations) from page sitemap.
Because WooCommerce has function wc_page_noindex which adds the robots META tags, there will be same tag twice in HEAD section (you can see HTML source). It’s possible to unhook this WooCommerce action:
remove_action( 'wp_head', 'wc_page_noindex' );