Support » Plugin: SiteTree » 1.43 WP 3.51 XML Sitemap Error

  • Resolved rrhobbs


    Altho, according to Google Webmaster Tools, it seems to validate, if I navigate to my xml sitemap, I encounter,

    “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. (blank page shows)

    The outward appearance ain’t real pretty, but if you view source all the posts, etc show.

    I have images sitemap turned off and have tried activating / reactivating Site Tree as well as saving a post.

    Any fix you might suggest that won’t delete all my posts I have hidden? (I have a lot)


Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Luigi



    the parsing error you are reporting is caused by three blank lines that precede the XML declaration of your Google Sitemap and I’m almost sure they are not related to a bug.

    There could be a script/plugin in your instal that outputs the blank lines before SiteTree sends the XML document to the browser/client or a “hidden” (visible only in the error log file) PHP error that generates them.

    The only way to fix it, it’s to find the cause. First, try the following:

    • Click on the “Rebuild” button, visit the Sitemap, refresh the webpage and finally check the error log file of your server.

    If you find something related to SiteTree, you may post it here. Otherwise go on:

    • Open the wp-config.php file and temporarily replace the line

    define( 'WP_DEBUG', false );


    define( 'WP_DEBUG', true );
    ini_set( 'error_reporting', E_ALL );

    Now, repeat the steps listed in the first point but this time, take a look at the source code of the Google Sitemap too.

    If you still haven’t found any error, the problem isn’t due to a bug nor to a PHP error. To check if the trouble comes from another plugin, you could attempt this:

    • Open the file /wp-content/plugins/sitetree/core/sitetree.class.php. In line 20 you should read

    const DEBUG_MODE = false;

    Temporarily replace false with true.
    Now, deactivate, one by one, all of your plugins and each time reload the Google Sitemap in your browser window by checking if the parsing error goes away.

    In case you don’t find the cause, you could ask a developer to debug your theme and/or your WordPress installation.

    Hi Luigi: It is evident that there is some kind of plugin / theme (?) conflict…

    I have a staging site by virtue of being hosted with WP-Engine; they suggested doing the age-old diagnosis of deactivating all the plugins and setting the them to TwentyTwelve, then reenabling the plugins one by one.

    Doing so and reenabling Site Tree first produces a site map that displays correctly; reenabling my prefferred theme (Weaver ll Pro) also produces a favorable result. It works till I get to a plugin that generates a widget to display an author hcard / vcard but alas things never seem to be that simple 🙁 disabling the hcard plugin and Site Tree, purging the caches (WP Engine does some heavy caching) then reactivating Site Tree and rebuilding the site map fails 🙁

    Obviously some further detective work is order but I hve in fact had Site Tree working on my site in the past and did just have it working temporarily.


    Plugin Author Luigi


    it isn’t a conflict but there’s a bug in the widget you are using instead.
    The author of the widget should remove all the line breaks that precede and follow the opening and the closing PHP tags respectively.

    Hi Luigi – thanks for the advice – altho the plugin author of the hcard / vcard plugin is to be admired for effort made, it is not the first and only coding gaff encountered using it, in fact reading up on its support forum there are a number of issues, so I am moving on to a different solution – hopefully one that does not barbeque other plugins and my theme !

    Update: after removing the hcard / card plugin (replaced by simply using the form on the site and placing the hcard in a text widget…) things still were not working.

    I then did the dreaded deactivate all the plugins and reenable them one by one … till I cam to – an outdated plugin with no updates available. When I reactivated that plugin I got an error message that the plugin was outputting two lines of unexpected data and that if I was having problem with feeds or rss I should deactivate or remove it. When I did, the Google sitemap went back to working normally.

    It should be noted that even when the sitemap appeared showing an error, the source seemed to validate for Google Webmasters Tools – testing it for errors reported a parsable sitemap.

    And it may not even be the plugin’s fault -I saved the neccesary text data used in the plugin, deactivated / deleted it and used clean options to clear out all its database data and reinstalled. Everything of course works perfectly 🙂

    I recently migrated my site; part of the migration workflow was exporting / importing the entire wp-content folder and mysql data. My hunch is something got corrupted along the the way. If two lines of code are all that went wrong then I dont have too much to gripe about.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘1.43 WP 3.51 XML Sitemap Error’ is closed to new replies.