Hello,
We apologize for the inconvenience you’re experiencing with your sitemap. The error message you’re seeing indicates an issue with the XML declaration in the sitemap file.
To resolve this issue, you can try the following steps:
-
Flush Permalinks: Navigate to your WordPress Dashboard → Settings → Permalinks and click the Save Changes button without making any changes to the permalink settings. This will flush the permalinks.
-
Flush Sitemap Settings: Go to Rank Math SEO → Sitemap Settings in your WordPress admin area. Change the value in the Links Per Sitemap field and click the Save Changes button at the bottom of the page.
If these steps don’t resolve the issue, please let us know, and we’ll be happy to assist you further.
Thank you for reaching out to us!
Sources:
Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank Math
Indexed, Not Submitted in Sitemap – Google Search Console » Rank Math
Rank Math Sitemap Issues and Their Fixes » Rank Math
How to Fix “Incorrect HTTP Header Content-Type” Error in Sitemaps » Rank Math
Hello team,
any update for this issue?
Hello,
The error message you are seeing indicates that there is some extra content before the XML declaration of your sitemap file.
Those whitespaces are being added there if there are blank spaces in your wp-config.php
file or your theme’s functions.php
file.
Also, this could be caused by a plugin, theme, or server configuration issue that adds whitespace, comments, or other output before the sitemap is generated.
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.
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.