• Resolved abozorgi80

    (@abozorgi80)


    Hello and thanks to supporting.

    I have a problem with Rankmath. when I want to open the sitemap_index.xml, there is an error and the sitemap doesn’t show!

    Please help me!

    The page I need help with: [log in to see the link]

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

    (@azibyaqoob)

    Hi,

    The error ‘XML declaration allowed only at the start of the document’ is typically caused when another file, plugin, or theme adds additional code or white space to the beginning of the sitemap file.

    In order to resolve this, I would first recommend clearing your site’s caching.

    If after clearing your site’s cache you are still experiencing the error on the sitemap, I would then next recommend checking your theme’s functions.php file for an empty line at the end of the file, as well as your wp-config.php file for any additional spaces at the beginning of the file.

    If you cannot find any empty lines at the end of your theme’s functions.php file or blank lines or spaces at the start of the wp-config.php, I would next recommend running a conflict check to identify whether another plugin or them is outputting the additional code in the sitemap file. The fastest way to do this is to deactivate all non-Rank Math plugins and switch to a standard theme like TwentyTwenty.

    Test this on your development or staging site, if you have one. If not, I recommend using the Health Check & Troubleshooting plugin. This plugin allows you to run a conflict check without affecting normal visitors to your site.

    Hope this helps!

    Thread Starter abozorgi80

    (@abozorgi80)

    I have been enabled ‘Troubleshooting Mode’ using the health Check. The sitemap is working properly, but how to find the conflict plugin? this is my plugin list:

    azibyaqoob

    (@azibyaqoob)

    Hi,

    In Troubleshooting mode, you should activate each previously active plugin one by one until you find the one causing this issue.

    I hope this helps.

    Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @abozorgi80,

    The error message you are seeing indicates that there is some extra content before the XML declaration of your sitemap file.

    Most likely a plugin has added blank whitespace at the beginning or end of its code. To determine that, please follow the steps here to check a conflict on your site:
    https://rankmath.com/kb/check-plugin-conflicts/

    You can check this link for more information:
    https://rankmath.com/kb/fix-sitemap-issues/#xml-text-declaration

    Let us know how this goes.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘sitemap error’ is closed to new replies.