WordPress.org

Ready to get started?Download WordPress

Forums

No RSS - XML parsing error (24 posts)

  1. GaryWhite855
    Member
    Posted 5 years ago #

    Clicked on my feed link and I got the following error
    =======
    XML Parsing Error: XML or text declaration not at start of entity
    Location: http://www.running-contacts.com/rcblog/feed/
    Line Number 2, Column 1:

    <?xml version="1.0" encoding="UTF-8"?>
    ^
    =========
    Did view source and <?xml etc is the second line first line is blank

    Feed was fine previously
    Where should I begin to try to solve this?

    WP 2.7.1

    Thanks for any assistance

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    Check through all files looking and remove any blank lines at the top or bottom.

  3. GaryWhite855
    Member
    Posted 5 years ago #

    Thanks,

    I have checked the Theme files header.php functions.php etc and removed blank line top and bottom but no change.

    I'll look at posts and pages next. Anywhere else?

    When I view page source the first section is:
    ____________________________

    <?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0"
    	xmlns:content="http://purl.org/rss/1.0/modules/content/"
    	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    	xmlns:dc="http://purl.org/dc/elements/1.1/"
    	xmlns:atom="http://www.w3.org/2005/Atom"
    	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    	>

    ______________________
    First line being blank

    Gary

  4. GaryWhite855
    Member
    Posted 5 years ago #

    I have removed blank lines from post & pages and from all of the xxx.php files in the Appearance editor.

    It is the Amazing Grace Theme if that has any relevance.

    There is still a blank line as the first line of the RSS feed and I get the following error message

    XML Parsing Error: XML or text declaration not at start of entity
    Location: http://www.running-contacts.com/rcblog/feed/
    Line Number 2, Column 1:<?xml version="1.0" encoding="UTF-8"?>
    ^
  5. GaryWhite855
    Member
    Posted 5 years ago #

    I have looked at all my xxxx.php files for white space and I have used the plugin here that is often recommended on this forum
    http://wordpress.org/extend/plugins/fix-rss-feed/

    The plugin found and reportedly fixed the white space problems - running it a second time found no errors.

    I deactivated all of my plugins and still get the error.

    What should I try next? Most of the posts on this forum indicate white space as the usual culpprit. Is there another way to check for it?

    Thanks

  6. esmi
    Forum Moderator
    Posted 5 years ago #

    Have you checked your wp-config.php file? wp-blog-header.php is another file possibility.

  7. GaryWhite855
    Member
    Posted 5 years ago #

    Yes Both. The fix-rss-feed plugin said that it found white space in a bunch of files and removed it. I re-ran it and it found none.

    I tried switching to the WP default theme and had the same error (No plugins and default theme)

    I think I'll try to do the upgrade to 2.8 and see if that helps. Don't know what else to try.

  8. esmi
    Forum Moderator
    Posted 5 years ago #

    I tried switching to the WP default theme and had the same error (No plugins and default theme)

    It's got to be in a core file then. Try re-uploading fresh copies of the wp-admin and wp-includes folders plus all files in the WP root folder.

  9. GaryWhite855
    Member
    Posted 5 years ago #

    I got it fixed.

    I used this

    http://wejn.org/stuff/wejnswpwhitespacefix.php.html

    Alternatively this may work for some:

    http://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/

    Thanks to all who helped out.

    Gary

  10. esmi
    Forum Moderator
    Posted 5 years ago #

    Just out of curiosity, where was the whitespace?

  11. GaryWhite855
    Member
    Posted 5 years ago #

    I never found it. That is I found some and corrected them to no avail.

    This plugin:
    http://wordpress.org/extend/plugins/fix-rss-feed/
    (that checks) said there were none - after it fixed them - but it still didn't work.

    What worked for me:
    http://wejn.org/stuff/wejnswpwhitespacefix.php.html
    seems to strip out white space? You could probably tell by looking at it (it's a small bit of code). So it might still be being generated and then removed.

    There is always a possibility that there was a cache issue also. I was clearing the cache (firefox/tools/privacy/etc) and trying other browsers but who knows?

    I did fix a typo in the blog before I saw results, so maybe the RSS needed to regenerate in some way? I'm still pretty new to wordpress - <2-months so...

    Thanks for the help, hope this exchange helps someone else too.

  12. GaryWhite855
    Member
    Posted 5 years ago #

    I see I missed your post about re-uploading fresh copies of the wp-admin and wp-includes folders plus all files in the WP root folder. We posted at nearly the same time. So for the record that didn't get tried.

    I did upgrade to 2.8 thinking that would give fresh versions of some files but it didn't solve the issue - unless a cache issue was at play.

  13. JohnP
    Member
    Posted 5 years ago #

    This quick fix worked for me

    Added this line to .htaccess:

    AddType x-mapp-php5 .php

    Long version - I had this problem on a fresh 2.8 install, default theme, no plugins - tried replacing all core files and checked all the likely suspects for whitespaces.

    So I tried installing wejnswpwhitespacefix.php and in the process used this line in my .htaccess to force php5:
    AddHandler application/x-httpd-php5 .php

    This fixed the error, but both feeds were now blank. I unistalled Wejn's script, and the feed was still blank, so I tried the alternative php5 switch, and found everything was working sweet!

  14. Manuel Schmalstieg
    Member
    Posted 5 years ago #

    I'm bumping into the same error.

    I hunted for blank lines in my theme's php files, but no result.

    The strange thing is that those two feeds:
    /feed/atom/
    /feed/rss/
    are working fine, the error occurs only in the following:
    http://ms-studio.net/feed/

    As i don't want to do any patches that will be overriden by the next WP update, i'm leaving it as is... but if someone wants to investigate i'm ready to testify.

  15. danieljenkinsphoto
    Member
    Posted 5 years ago #

    I've been fighting this problem all day, and luckily found it inside of one of my plugins wp-print. The issue is trailing line feeds after the ?> tag or space or linefeed before the <?php

    In a few of the files in the plugin folder for wp-print, it seemed the php files were double spaced, so i removed the extra spaces and voila!

  16. dwheeler
    Member
    Posted 4 years ago #

    I had the same problem and found it in plugin.

    If it used to work before, try disabling the plugins one at a time.

  17. jazbek
    Member
    Posted 4 years ago #

    I had no problem viewing my RSS feed when I was developing locally, but once I copied all the files to my webserver I was getting this error. When I viewed source of my /feed/ URL, I could see there was a line break before the XML declaration at the top of the file.

    Since the exact same files were working on my localhost installation, I knew it wasn't due to any plugins or trailing whitespace at the end of any of my files because that would have caused an issue on my local copy as well.

    Somehow I was able to fix the problem by opening wp-includes/feed-rss2.php, making a change in the file, saving it, uploading it, undoing the change (so it was exactly the same as before), and then uploading again. No clue why that fixed it, but it did.. there's no longer a blank line being output at the beginning of the XML file.

    HTH someone..

  18. letsnurture
    Member
    Posted 4 years ago #

    Hi folk,

    This problem occurs because of the leading space before xml content.

    I faced the same problem and then i found the solution at
    http://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/

    And it works pretty well for me.

    Hope, it could be helpful to someone!!!!!!!!

    Regards,
    http://www.google.com/profiles/sachinpethani

  19. claire.mcmanus
    Member
    Posted 4 years ago #

    Hello

    I have this problem on http://www.thewhatwherewhen.org

    I have gone through my files and can not see the line

    I have done this
    http://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/
    and this
    http://wejn.org/stuff/wejnswpwhitespacefix.php.html

    I have disabled all my plugins and still have this problem

    Can anyone help?

    Thanks

  20. IdeFixx
    Member
    Posted 4 years ago #

    [letsnurture]: Thank you very much for this solution of broken RSS feed, it works, it's simple and it take much shorter time then looking everywhere in core/templates files... I'd say 5 minutes? :)

  21. shirasmane
    Member
    Posted 4 years ago #

    Hello,

    I am facing the same problem on my site http://www.iplt20livecricketscorescard.com

    I have checked all the php files in my theme as well as wordpress root files and removed all the white spaces & blanks

    But still no success.

    Please help.

    Thanks

  22. shirasmane
    Member
    Posted 4 years ago #

    the solution mentioned in the above link http://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/ worked for me.

    I added following code to wp-includes/feed-rss2.php and it worked

    $out = ob_get_contents();
    $out = str_replace(array("\n", "\r", "\t", " "), "", $input);
    ob_end_clean();

    However when first I applied the above code it did not work, then I realized that 'WP Super Cache' may be showing the same page again, I deleted all the cached pages and it started working.

    thank you all.

  23. M Asif Rahman
    Member
    Posted 4 years ago #

    This solution work
    http://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/

    But it cause few problem in my site, first my index was completely broken. Then still none of my feedburner feed updated, i pinged few times, still same old post.

  24. xavier.tnc
    Member
    Posted 4 years ago #

    I had the same problem on my site and this post helped. I just searched for how to remove spaces in front of <?xml. The solution that worked for me was to check my PHP files for spaces or other unseen characters before the first <?php tag in every file included / required to render the page producing the error. According to the advice I found, this is a known issue with PHP and also goes for any characters after the last ?> tag. (Including "\n" - line feed character). I hope this helps someone speed up their fault find.

Topic Closed

This topic has been closed to new replies.

About this Topic