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
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
- Download the following file http://webfreelance.info/tool/webfreelancewhitespacesfix.php
- 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
So it should look something like:
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.