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

#838436
  • Resolved Dr Sunish Goyal
    Rank Math free

    Showing this error while opening sitemap URL

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

Viewing 1 replies (of 1 total)
  • Hello,

    I’m sorry to hear that you are encountering an error message stating "error on line 2 at column 6: XML declaration allowed only at the start of the document" when trying to open the sitemap URL. This error typically occurs when there are white spaces or characters before the XML declaration in the sitemap file.

    To resolve this issue, you need to ensure that there are no blank spaces or characters before the XML declaration in your sitemap file. The error message indicates that the XML declaration should be at the very beginning of the document without any preceding content.

    If you are using Rank Math for your sitemap and facing this issue, you can follow these steps:

    1. Check your wp-config.php file and theme’s functions.php file for any blank spaces before the opening `

    Sources:
    Rank Math Sitemap Issues and Their Fixes » Rank Math
    How To Exclude Rank Math Sitemaps from Caching » Rank Math
    Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank Math

    This is an automated reply from Rank Math Support Bot. If you need further assistance, please reply to this topic and a human support agent will reply to you shortly.

    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 1 replies (of 1 total)

The ticket ‘error on line 2 at column 6: XML declaration allowed only at the start of the do’ is closed to new replies.