How to fix XML parsing feed error in wordpress

When I started my blog, I found my RSS feed was not functional and was giving some error like “XML Parsing Error: XML or text declaration not at start of entity”. It was kind of invalid XML feed and the solution was to remove the white spaces before XML declaration.

I went to feed-rss2.php, feed-rss.php and removed the spaced but it never worked. There was no proper solution in google search and then I found a website w3it which have a good tip to solve this problem. It was about adding few lines of code in feed-rss2.php and/or feed-rss2-comments.php. Here is an excerpts from the site:

What we need, is to add a little tip in specific files where wordpress feeds are made up before to be outputted to the browser on request.

So, we go to fix this by opening the follow file, if the feed we want is RSS2 in wordpress (we will see all any other after in any case):

wp-includes/feed-rss2.php

open it with a text editor and read on the very top section, the following code:

header(‘Content-Type: text/xml; charset=’ . get_option(‘blog_charset’), true);

$more = 1;

To fix the feed on wordpress (but not only, it is obviously valid in, and for, any other feed or non feed contest where we can have the same necessity), add this tricky Php code immediately after:

$out = ob_get_contents();

$out = str_replace(array(“n”, “r”, “t”, ” “), “”, $input);

ob_end_clean();

Do the same almost with the comment’s feed file: feed-rss2-comments.php

Save/replace the feed-rss2.php and the feed-rss2-comments.php files modified in this way and enjoy your re-enabled feeds!

And yesterday I faced the same problem once again and this tip did not work. And then I found wordpress plugin which does this job so smartly. This plugin is know is fix-rss-feed developed by flyaga.info. This wordpress plugin fixes this issue in no time.

I dont think I need to explain how it works but in case if you are new to wordpress, here are the steps. Download the plugin from the above link and install / activate it. Login to Admin control panel, under setting you can see fix rss feed link. Go to that link and press fix wordpress RSS feed button and you are done.

No related posts.

6 Responses to “How to fix XML parsing feed error in wordpress”

  1. I enjoyed the article and thanks respecting posting such valuable info emoluments of all of us to skim, I fit up it both valuable and communicative and I cheque to be aware of out it as over as I can.

  2. poed says:

    Download the plugin from the above link and install what damn link. The damn site is down and you got a visit with this crap information. But may you burn in hell.

  3. mccarl says:

    Well, the problem does not seem to be on your side ; you are the user of that website, and the problem looks like to be in the code of that website. The people who created/coded that forum made an error in their code, which cause you to be unable to use it, as for everyone.

    Try to see if you can submit this bug to that website admins.

  4. sim says:

    XML Parsing Error | Elance Job: I cannot figure out how to fix a xml parsing error and need help. Thi #WordPress #Jobs

  5. Krish says:

    There are many ways to fix this.. Read the below article..Nice one

    http://www.globinch.com/2010/09/15/wordpress-rss-feed-xml-parsing-error/

  6. Caramoan says:

    you can see that there is a massive growth in online advertising these days, google paved the way on ppc -,~


Leave a Reply

Our Sponsors

Our Sponsors

Archives

Invesp landing page optimization

Web Analytics