Sitemap Created By rankmath Giving Error

#897619
  • Resolved Pitch Worx
    Rank Math free

    sitemap page giving 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.
    please fix this

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello, we apologize for the issue you are facing with your Rank Math sitemap. The error message you are seeing, "XML declaration allowed only at the start of the document," typically indicates that there are extra spaces or blank lines before the XML declaration in your sitemap file.

    To resolve this issue, please follow these steps:

    1. Check for White Spaces: Ensure there are no blank lines or spaces before the ` line in your sitemap file. This can often happen due to a blank line in yourwp-config.phpfile or your theme'sfunctions.php` file.
    2. Plugin Conflict: If you do not find any white spaces, check for a plugin conflict using the Health Check plugin.
    3. Clear Cache: Make sure to clear any caching plugins you may be using, as they might be serving an outdated version of your sitemap.

    If the problem persists after trying these solutions, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.

    For more detailed information, you can refer to our article on fixing sitemap issues here.

    Sources:
    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 if there is any extra line or space before the XML. This is caused by a blank line or space in your wp-config.php or functions.php file.

    If you’re not able to find any white space then you can try to follow this guideline to fix the issue: https://wejn.org/stuff/wejnswpwhitespacefix.php.html

    Once done, please try to clear the Sitemap cache by following this video screencast and see if that works for you: https://i.rankmath.com/pipRDp

    However, if you are unable to do this or if the fix does not work, please include your FTP details in the sensitive data section so we can fix this for you.

    We look 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 Created By rankmath Giving Error’ is closed to new replies.