Hello,
I’m sorry to hear about the sitemap error you are facing on your websites. To resolve the "XML declaration allowed only at the start of the document" issue, you can follow these steps:
-
Check for Plugin Conflict:
- Use the Health Check plugin to identify any conflicts caused by plugins. Deactivate all plugins except Rank Math and check if the issue persists.
-
Add Filter to Theme’s rank-math.php File:
- If removing whitespace and cache didn’t work, you can add a filter to your theme’s
rank-math.php file to disable sitemap caching. Here’s how:
-
Confirm Sitemap Functionality:
- After applying the changes, check your sitemap using an XML Sitemap validator to ensure the error is resolved.
If these steps do not resolve the issue, please feel free to reach out to our support team directly here for further assistance. We are here to help you with any additional support you may need.
Thank you for your patience and understanding. If you have any more questions or need further assistance, please let us know.
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
How to Fix "Incorrect HTTP Header Content-Type" Error in Sitemaps » Rank Math
Hello,
Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.
We checked your sitemap and we can see it is working properly without any issues. Please check the screenshot in the sensitive data section for reference.
If you’re still facing the issue, please clear your browser cache and check again.
Hope that helps and please don’t hesitate to let us know if you have any other questions.
Thank you.
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.