Sitemap error: XML declaration allowed only at the start of the document
-
Firefox says:
XML Parsing Error: XML or text declaration not at start of entity
Location: http://hanfjournal.de/sitemap_index.xml
Line Number 4, Column 1:<?xml version=”1.0″ encoding=”UTF-8″?><?xml-stylesheet type=”text/xsl” href=”//hanfjournal.de/main-sitemap.xsl”?>
^Chromium says:
This page contains the following errors:
error on line 4 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.(Below is empty.)
Sorry, this is not fixed. I found two very, very old threads, but I still have the same problem at http://hanfjournal.de/sitemap_index.xml
In those old threads (links below) it was suggested to remove empty lines from functions.php, which I did, I also removed all comments to make sure, but this does not seem to help in any way.
But I only removed empty lines from our custom (child) theme’s functions.php. I do not think it could be right to make me modify the original theme’s functions.php, which is 39501 bytes in size, more than 1000 lines and a lot of empty lines.
Where is the error? Even if modifying functions.php maybe will help, it still is not a solution, not even a bugfix, only a bad workaround, because functions.php will be replaced as soon as there is a theme update and then there is the problem again.
Any other solutions?
https://wordpress.org/support/topic/sitemap-error-xml-declaration-allowed-only-at-the-start-of-the-document?replies=7
https://wordpress.org/support/topic/xml-parsing-error-xml-or-text-declaration-not-at-start-of-entity-1?replies=6
- The topic ‘Sitemap error: XML declaration allowed only at the start of the document’ is closed to new replies.