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

Worpress error on line 2 at column 6

There are reasons due to which your RSS feeds might be broken and you end up seeing this error. So if you see this error when loading your RSS feeds:

WordPress error on line 2 at column 6 xml declaration allowed only at the start of the document

Or

it fails to pass RSS W3C validation with message like:

This feed does not validate.

line 1, column 1: Blank line before XML declaration [help]

here I have a very easy solution, you don’t need to panic or start looking for some plugin to fix this problem.

There are few possible solutions you can try:

Go to http://feedvalidator.org/docs/error/WPBlankLine.html and try to fix this.

Use some plugin to fix it

Find a developer like me and pay lots of money

Try doing it your own by simply following few instructions

Last option makes sense? Ok, than here is what you need to do in order to fix this issue

  • After downloading, upload this webfreelancewhitespacefix.php file to your wordpress root folder where wp-config.php file is kept. Do not put it in themes or plugin folder
  • Edit your index.php file stored in root folder and insert the following line just above the first line

include(“webfreelancewhitespacefix.php”);

So it should look something like:

include(“webfreelancewhitespacefix.php”);

define(‘WP_USE_THEMES’, true);
require(‘./wp-blog-header.php’);

Reload or refresh your feed page and it would work as expected.

Hope this would remove “WordPress error on line 2 at column 6 xml declaration error from your site and your feeds” error.

“I am PHP Freelancer having more than 7 years of experience, if you want to do any project with me then you can contact me.”

Be Social, Share!