Sitemap error after switching from Yoast

#800247
  • Resolved Anonymous
    Rank Math free

    Hey, there,

    I just switched from Yoast to Rank Math on the WP website themamasutra.com and the sitemap (https://themamasutra.com/sitemap_index.xml) is now showing an error:

    This page contains the following errors:
    error on line 2 at column 6: XML declaration allowed only at the start of the document
    Below is a rendering of the page up to the first error.

    I have cleared the website cache but the error message still appears. Please advise and thank you!

    Marquis

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

    I understand that you are facing an issue with the sitemap on your website themamasutra.com after switching from Yoast to Rank Math. The error message you provided indicates an XML declaration error.

    To resolve this issue, you can follow these steps:

    1. Check for Blank Spaces: Ensure there are no blank spaces before the XML Sitemap’s source code. These spaces might be added by a blank line/space in your wp-config.php file or your theme’s functions.php file.

    2. Disable Caching: Disable any caching plugins or server-level caching that might be interfering with the sitemap functionality. You can exclude the sitemap files generated by Rank Math from being cached in your caching plugin. Here is a guide on how to exclude sitemaps from caching.

    3. Plugin Conflict: Check for any plugin conflicts using the Health Check plugin as conflicting plugins can sometimes affect the sitemap functionality.

    If the issue persists after following these steps, please let us know, and we will be happy to assist you further.

    Thank you for reaching out with your concern!

    Sources:
    Why the Sitemap_Index.xml is Throwing a 404 Error » Rank Math
    Rank Math Sitemap Issues and Their Fixes » Rank Math

    Hello,

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

    This sitemap error indicates that there must be some white space before the XML Sitemap’s source code. You can also look at the source code of Sitemap and see there is an extra line before the XML. This is caused by a blank line or space in your wp-config.php or functions.php file.

    Please follow this troubleshooting guide to fix that issue:
    https://rankmath.com/kb/fix-sitemap-issues/#xml-text-declaration

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

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘Sitemap error after switching from Yoast’ is closed to new replies.