Fixing WordPress Sitemap.xml Error on Line at Column 6 or 7

error on line 2 at colum 6 : XML declaration allowed only at the start of the document

site map error

This issue typically happens when a plugin or theme function incorrectly adds empty whitespace at the beginning of the sitemap. Please view the source code of your sitemap following the steps here.

Fixing WordPress Sitemap.xml Error on Line at Column 6 or 7

Sitemap XML Error

Why is there an ‘XML or text declaration not at the start of entity’ error inside Google Webmaster Tools?
There must be some white-spaces before the XML Sitemap’s source code.

 

whitespace

 

Solution is very easy: go to cpanel and open wp-config.php file, clean this whitespace (before the <?php line)

 

Fixing WordPress Sitemap.xml Error on Line at Column 6 or 7 1

Sometimes, this issue start with functions.php

same solution is here, go to functions.php file and remove the whitespace.

You may need to clear your cache from your plugins/theme/CDN such as Cloudflare/server caching etc. If you are not sure how to clear cache, please speak with your developers or contact your host provider.

Sending
User Review
5 (1 vote)

Leave a Reply

Translate »