Sitemap: error on line 2 at column 6: XML declaration

#795389
  • Resolved Anonymous
    Rank Math free

    My sitemap is not displaying.

    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 followed the indications in other support topics regarding this error.

    There are no whitespaces nor empty lines in neither the wp-config.php nor the functions.php

    I also followed https://rankmath.com/kb/check-plugin-conflicts/. The result from the troubleshooting is:

    (a) If you still have the issue, your WordPress setup is the root of the problem.

    The WP installation structure is custom and must not be changed, but it has been built with what WordPress allows to do, without modifying core files. Attached as sensitive data you’ll find the structure.

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

    I apologize for the issue you are facing with your sitemap not displaying and showing an error related to the XML declaration. It seems like you have already checked for whitespaces and empty lines in the wp-config.php and functions.php files, and also followed the steps to check for plugin conflicts without success.

    Since you mentioned that your WordPress installation structure is custom and must not be changed, I recommend validating your sitemap to ensure it is correctly configured. You can use the Validate XML Sitemap tool by entering your sitemap URL and clicking on VALIDATE SITEMAP to confirm if there are any issues detected.

    If the validation does not reveal any issues, and the problem persists, please provide the sensitive data related to your custom WordPress installation structure so that we can further investigate and assist you in resolving the sitemap display error.

    Thank you for your cooperation in providing the necessary information for us to help you effectively.

    Sources:
    Rank Math Sitemap Issues and Their Fixes » Rank Math
    Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank Math
    Remove Blank Lines From Sitemaps » Rank Math

    Hello,

    Thank you for contacting Rank Math support.

    Please follow this guide to apply the whitespace fix to your site: https://wejn.org/stuff/wejnswpwhitespacefix.php.html

    If you’re not sure, please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Anonymous
    Rank Math free

    Fixed!

    There was an empty line at the beginning of index.php, which I found when I was going to apply the solution from the provided link.

    Thank you!

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on
    https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post

    about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘Sitemap: error on line 2 at column 6: XML declaration’ is closed to new replies.