• Resolved PoliteShrimp

    (@terminator_5505)


    Woocommerce Cart and Account pages have robots noindex meta tag by default.
    But yoast plugin includes these pages in the sitemap file.
    Changing settings for these pages from the wp-admin yoast seo box can solve the problem and remove the pages from the sitemap file. Doing this will cause the site to show duplicate robots noindex tag for these pages.
    This plugin should be updated to not include pages like the woocommerce cart page in the sitemap file as these pages are noindex by default.
    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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?

    Thread Starter PoliteShrimp

    (@terminator_5505)

    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.

    Thread Starter PoliteShrimp

    (@terminator_5505)

    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.

    Saša

    (@stodorovic)

    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' );

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Woocommerce cart and account page in sitemap’ is closed to new replies.