Xml xml parsing error or text ad not at start of object in wordpress feed

I get the following error on my Wordpress site,

XML Parsing Error: XML or text declaration not at start of entity
Location: http://www.domain.com/news/feed/rss/
Line Number 3, Column 3:        <?xml version="1.0" encoding="UTF-8"?><rss version="0.92">
----------------^

I tried almost all the solutions found with google, also tried the answers to the same questions here in stackoverflow, but still I get this error.

Does anyone have an idea on how to get out of it?

+5
source share
3 answers

Try installing the fix-rss-feed plugin.

Also I think you have a space before <?xml version="1.0" encoding="UTF-8"?>. The trick should get rid of this.

+2
source
0

In my opinion, instead of using the plugin, the best solution would be to remove all trailing spaces in all PHP files in your themes directory. In the terminal window, run:

cd yoursite/wp-content/themes/yourtheme

then run

find ./ -name "*.php" -exec sed -i -e '/^\n*$/d' {} \;

After that, try going to yoursite.com/feed

0
source

All Articles