I just fixed one of the most confounding problems I’d ever come across on WordPress, so I’m sharing how I did it because I definitely couldn’t find the solution after weeks of trying.
See I was trying to get the valid XML feed for a particular Tag or Category from this blog, a process I’ve instigated on PLUG’s mailing list, so that the PLUG website can aggregate feeds tagged as ‘plug’ or ‘open source’ or ‘foss’ voluntarily submitted by its (currently 130+ strong) membership.
The problem was when I try to get the feed URL, for example:
I get this error:
XML Parsing Error: xml declaration not at start of external entity
Line Number 2, Column 1:
<?xml version=”1.0″ encoding=”UTF-8″?>
After weeks of searching and asking at the WordPress Forums to no avail, I’ve finally tried validating at Feedvalidator, which recommended amongst other things, I check my wp-rss2.php.
And there I found it. What looks like this:
should be like this:
In short, remove the spaces on line #9 on your wp-rss2.php. Now it’s validating. Check it here.
Can’t wait to apply it on the other sites. Basketball Exchange, in particular, has got XML errors up the wazoo.
2 thoughts on “XML Feed Finally Validating”
I’m getting this error on my client’s blog:
XML Parsing Error: XML or text declaration not at start of entity
Line Number 2, Column 1:<rss version=”2.0″
And I’ve done as you suggested in the relevant file and I’m still getting the error. Any ideas?
Try the ff.:
Remove all unecessary spaces within the wp-rss.php file and wp-config.php file. There’s an extra space at the bottom part of wp-config.php for example.
Use a fresh wp-rss.php from the wordpress site. Or maybe completely re install all files again, rewriting over the old ones.
Check all your feeds. Your archive feed, your tag feed, etc.
All else fails, check your ATOM feed to see if that works and consider using that instead.
hope this helps evie.