• M3

    (@emmtre)


    The XML declaration in the Yoast site maps are displayed as HTML comments in the cached site maps and the “X-Robots-Tag: noindex, follow” is also removed in the cached sitemap. So site maps now are displayed in Google search results because of this. Any suggestion how to fix this problem?

    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="//website.com/main-sitemap.xsl"?>
    <!--?xml version="1.0" encoding="UTF-8"?-->
    <!--?xml-stylesheet type="text/xsl" href="//website.com/main-sitemap.xsl"?-->

    https://www.ads-software.com/plugins/w3-total-cache/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter M3

    (@emmtre)

    Is there any solution to this problem? I had to disable caching of sitemaps.

    Hi. I havent explored this problem u’re having (busy) but have you tried excluding the sitemap via the exclusion box as a regex in w3tc? But then maybe u want it cached?

    As for the missing header…again, i havent explored the reason why it would be missing but have you tried adding this missing header via your htaccess file whereby it is only added under the condition that the sitemap is served up?

    And i am not sure how your sitemap is generated but there might be the option of using ob_* (output buffering) and then use preg_replace to strip the comment open and closing tags. But i figure that is overkill and should only be used as a last resort.

    Thread Starter M3

    (@emmtre)

    As the headline says I’m using Yoast SEO plugin to the create site maps and W3TC even has an built-in extension to comply with Yoast SEO.

    W3 Total Cache should not convert the XML declaration to HTML comments in the cached site maps or remove “X-Robots-Tag: noindex, follow”.

    And yes I had to disable caching of the site maps via the exclusion box as a regex since the site maps are displayed in Google search results because of this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Bug Yoast Sitemaps’ is closed to new replies.