XML sitemap error

#924041
  • Resolved Katie Vine
    Rank Math free

    I’ve been receiving an error since yesterday on my website attempting to view the post-sitemap1 (all other sitemaps work). I attached the images below of the error.

    error on line 2 at column 6: XML declaration allowed only at the start of the document

    I attempted to look up a solution for the problem and saw that maybe I needed to look at the functionsphp for my theme in case there were any spaces. I attached a screenshot of that as well showing there are no spaces before.

    Thanks for your assistance

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    The issue is occurring because the HTML comment is showing before the XML tag. Please check the screenshot in the sensitive data section for reference.

    In this case, please try to follow the steps below and see if that works for you:

    1. Flush the Sitemap cache by following this video screencast:
    https://i.rankmath.com/pipRDp

    2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
    https://rankmath.com/kb/exclude-sitemaps-from-caching/

    If the issue persists, please follow this guideline to check if any other plugins/themes are conflicting: https://rankmath.com/kb/check-plugin-conflicts/

    Let us know how it goes. Looking forward to helping you.

    Hi, so the caching suggestions didn’t have any effect, so I kept on digging and am just going to mention what I found in case anyone else runs into the problem.

    It seems like other people with the error also had WebP Express plugin. I went into the settings and under the “Alter HTML”, there was a radial button for “how to replace”. Swapping it from complete page to content filtering hooks allowed the post1 sitemap to show up.

    Can’t tell you the intricacies of what it did, but the issue seems solved for now.

    Hello,

    Glad that you have sorted everything out.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this ticket.