Title: XML Declaration Error
Last modified: December 22, 2019

---

# XML Declaration Error

 *  Resolved [Peter](https://wordpress.org/support/users/hardpeter4u/)
 * (@hardpeter4u)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/xml-declaration-error-2/)
 * Hi,
    I’m getting the following error:
 *     ```
       This page contains the following errors:
       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.
       ```
   
 * When I view the source of the page there is indeed a blank line on line “1”.
   
   The below starts on line “2”.
 *     ```
       <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="https://example.com/wp/wp-content/plugins/google-sitemap-generator/sitemap.xsl"?><!-- sitemap-generator-url="http://www.arnebrachhold.de" sitemap-generator-version="4.1.0" -->
       <!-- generated-on="December 22, 2019 5:40 AM" -->
       ```
   
 * How can this be corrected?
    Thanks, peter

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

 *  [pentamads](https://wordpress.org/support/users/pentamads/)
 * (@pentamads)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/xml-declaration-error-2/#post-12376911)
 * Hello.
    I’m not sure if you already fixed this issue, I managed to fix this error,
   by checking my funtions.php in my theme folder for any unnecessary PHP tags with
   spaces in between them. This creates some empty lines, that you can see if you
   view the source code of you sitemap in the browser.
 * All of this is mentioned in the FAQ and some other solutions if this doesn’t 
   work.
 *  [https://www.arnebrachhold.de/projects/wordpress-plugins/google-xml-sitemaps-generator/help/](https://www.arnebrachhold.de/projects/wordpress-plugins/google-xml-sitemaps-generator/help/)(
   almost at the bottom of the page)
 *  Thread Starter [Peter](https://wordpress.org/support/users/hardpeter4u/)
 * (@hardpeter4u)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/xml-declaration-error-2/#post-12377356)
 * Thanks. got it fixed. Marked as resolved

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

The topic ‘XML Declaration Error’ is closed to new replies.

 * ![](https://ps.w.org/google-sitemap-generator/assets/icon-256x256.png?rev=2713572)
 * [XML Sitemap Generator for Google](https://wordpress.org/plugins/google-sitemap-generator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-sitemap-generator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-sitemap-generator/)
 * [Active Topics](https://wordpress.org/support/plugin/google-sitemap-generator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-sitemap-generator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-sitemap-generator/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Peter](https://wordpress.org/support/users/hardpeter4u/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/xml-declaration-error-2/#post-12377356)
 * Status: resolved