Title: XML sitemaps error
Last modified: October 21, 2020

---

# XML sitemaps error

 *  Resolved [ritut](https://wordpress.org/support/users/ritut/)
 * (@ritut)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/xml-sitemaps-error/)
 * Hi,
 * Yoast plugin doesn`t creates xml sitemap to my page. When I click on “See the
   XML sitemap” I get this error message: “error on line 2 at column 6: XML declaration
   allowed only at the start of the document
    Below is a rendering of the page up
   to the first error.”. I tried to solve this problem with saving the permalinks,
   but nothing changed. Can you help me, please?
 * Thank you very much in advance!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fxml-sitemaps-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Suwash Kunwar](https://wordpress.org/support/users/suascat_wp/)
 * (@suascat_wp)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/xml-sitemaps-error/#post-13561009)
 * Hi [@ritut](https://wordpress.org/support/users/ritut/),
 * You mentioned you’re having an issue with your sitemap where it returns the error:`
   error on line 2 at column 6: XML declaration allowed only at the start of the
   document`.
 * This error typically happens when a plugin or theme function incorrectly adds
   empty whitespace at the beginning of the sitemap. The Yoast SEO plugin does not
   cause this issue.
 * However, the cause most often is an empty line at the end of the `functions.php`
   file.
 * To troubleshooting the issue, please follow the steps indicated in this guide.
 * If there is no empty line in this file, we highly recommend running a conflict
   check to identify what outputs the empty white spaces. If you are not familiar
   with How to perform a conflict check, we have useful [documentation here](https://yoast.com/help/how-to-check-for-plugin-conflicts/)
   to guide you in the process.
 * Finally, you may also need to clear your cache from your plugins/theme/CDN, such
   as Cloudflare/server caching, etc. If you are not sure how to clear the cache,
   please speak with your developers or contact your host provider.
 * Once you have identified whether your theme or a plugin causes the issue, please
   contact the developers of the theme or plugin to find and remove the whitespace.
 * I hope it helps and please let us know if some other question comes up, and we
   can be of further assistance.
 *  [devnihil](https://wordpress.org/support/users/devnihil/)
 * (@devnihil)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/xml-sitemaps-error/#post-13586833)
 * We are going ahead and marking this issue as resolved due to inactivity. If you
   require any further assistance please create a new issue.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘XML sitemaps error’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [devnihil](https://wordpress.org/support/users/devnihil/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/xml-sitemaps-error/#post-13586833)
 * Status: resolved