Hello,
We apologize for the issue you are facing with your sitemap. The error message you are seeing indicates that there is an empty space or blank line before the XML declaration in your sitemap file. This can happen if there are extra spaces or lines in your wp-config.php
file or your theme’s functions.php
file.
To resolve this issue, please follow these steps:
- Check for Blank Spaces: Open your
wp-config.php
and functions.php
files and ensure there are no blank lines or spaces before the “ line.
- Plugin Conflict: If you do not find any blank spaces, it might be a plugin conflict. You can use the Health Check plugin to identify any conflicting plugins.
- Clear Cache: Make sure to clear any caching that might be interfering with the sitemap functionality.
If the problem persists after checking these areas, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.
Thank you for raising this concern!
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
Hello,
Thank you for your query and we are so sorry about the trouble this must have caused.
You will have to check all the PHP files present in your site’s root directory and see if any one of those has an unwanted whitespace after the opening PHP tag. You can also use the hint available in the following guide to track down which file is causing the issue: https://wejn.org/stuff/wejnswpwhitespacefix.php.html
That should fix the issue.
Please let us know if that does not. We are here to assist.
Ok, I found the error, there is malware through plugin on all my site that is the reason behind this
Hello,
We are glad that you managed to resolve the issue.
Can you please confirm if you still need our assistance with anything else or we can close the ticket?
Looking forward to hearing back from you.
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.