XML Parsing Error: XML or text declaration not at start of entity

by Ateeq Rafeeq, April 17, 2013

In wordpress this is possible to get a blank line before php <?php  tag or after ?> tag. This produce problem for RSS feed this seems very easy to handle things in wordpress as we always see for plugins etc, But its not very easy.

You should know php closing tag ?> is not essential its optional php can close itself when page ends so if you are not ending your php at end of page lik ?> then there are rare chances for php to get a whitespace after closing tag.

Here are different files you can check for blank spaces.

  1. Check your theme’s header.php , footer.php, functions.php , sidebar.php, index.php.
  2. Check your wp-config.php if that have any whitespace before or after php tag.
  3. Check includes/feed-atom.php and includes/feed-rss2.php files for possible blank spaces.
  4. You can deactivate all plugins and reactivate them. Or try to change plugins forlder name to something else then you can take it back as plugins after test.
  5. Make sure this is on first line of your header.php <!DOCTYPE and where header.php are being get like index.php they do not have blank line before adding this <?php include(‘header.php’); ?> tag.

There can be more reasons but 95% this is the reason of blank space after or before php tags. <?php ?> .


Follow Us

Popular Posts

Webful Creations Vision

All rights reserved