Sitemaps seems not working well

  • Hi. When I try to see any sitemap, I receive this message:

    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.

    Is the sitemap working? How can I fix this issue?

    Thanks and regards.

Viewing 1 replies (of 1 total)
  • Hello,

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

    That is usually due to an extra whitespace at the end or beginning of the functions.php file on your theme or one of your plugin files.

    To find find the issue you have to find first the cause. You can do this by doing the following:

    1. Install and activate a default theme on the site. Clear your cache, resave your permalinks settings and check if the issue disappears from your sitemap.

    2. If the issue is not with your theme, you can reactivate your theme then go to plugins page. Deactivate the plugins one by one, while still checking your sitemap until you find the cause of the issue.

    If not the issue is not with either your theme or plugins, then it is likely coming from your wp configuration file(s)

    You can also try this guide here: to fix all whitesapces on your files.

    Hope that helps. If you have any further question(s), please let us know. Thank you.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.