Hello,
We apologize for the issue you are facing with generating your sitemap. The error message you are encountering, "XML declaration allowed only at the start of the document," typically indicates that there are unwanted characters or spaces before the XML declaration in your sitemap.
Since you’ve already checked for blank spaces in your wp-config.php
and functions.php
files, as well as potential plugin conflicts and cleared your cache, here are a few additional steps you can take:
-
Check for Output Before XML Declaration: Ensure that there is no output (like echo statements or whitespace) before the XML declaration in your sitemap file. This can sometimes happen if there are any stray characters or spaces in your theme files or plugins that output content prematurely.
-
Disable All Plugins Temporarily: If you haven’t already, try disabling all plugins except Rank Math to see if the issue persists. If the sitemap works after this, re-enable your plugins one by one to identify the conflicting plugin.
-
Switch to a Default Theme: Temporarily switch to a default WordPress theme (like Twenty Twenty-One) to check if the issue is related to your current theme.
-
Check Server Configuration: Sometimes server configurations can cause issues. Ensure that your server is set up correctly to handle XML files.
If these steps do not resolve the issue, please reply to this ticket with your site URL so we can assist you further. A human agent from our support team will take over and provide more specific guidance based on your site setup.
Thank you for your patience!
I did that but no solution.
Can You please solve that from your side
This is my site url
https://traveleverytime.com/
Hello,
Please note that this is not an issue from the Rank Math plugin that we can fix from our end. If you check the source code of any other page of your website, you’ll see the same blank line:

Because of this blank line, Rank Math is unable to generate the sitemap properly on your website.
However, if you’re not able to find any blank lines in the wp-config.php
or functions.php
files, you can try to follow this guideline to fix the issue: https://wejn.org/stuff/wejnswpwhitespacefix.php.html
Once done, please try to clear the Sitemap cache by following this video screencast:
https://i.rankmath.com/pipRDp
Let us know how it goes. Looking forward to helping you.
Thank you.
Didn’t work or understand
can you solve that issue if possible !
Hello,
We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.

It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Sir I can’t Understand what to do
Hello,
The cause of the issue and its solution are explained here.
If you would like us to fix the issue for you, please share your WordPress & FTP logins in the designated Sensitive Data section as we instructed.
Looking forward to helping 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.