WordPress.org

Ready to get started?Download WordPress

Forums

RSS Doesn't Work - XML Parsing Error (63 posts)

  1. webwhat
    Member
    Posted 6 years ago #

    Hello,

    My blog's http://best-anti-aging.com/blog/rss is not working. It gives we this error.

    XML Parsing Error: xml declaration not at start of external entity
    Location: http://best-anti-aging.com/blog/rss
    Line Number 2, Column 1:<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3" -->

    How do I fix this?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    You have the blank line problem.

    See here: http://validator.w3.org/feed/docs/error/WPBlankLine.html

  3. judahfreed
    Member
    Posted 6 years ago #

    I'm getting almost the same error message:

    XML Parsing Error: xml declaration not at start of external entity
    Location: http://media-visions.com/media_reports/?feed=rss2
    Line Number 2, Column 1:<?xml version="1.0" encoding="UTF-8"?>

    As recommended, I've checked all the files cited in this post:
    http://validator.w3.org/feed/docs/error/WPBlankLine.html

    The error is still occurring, and it occurs no matter which theme I install.

    This is the blog at issue:
    http://media-visions.com/media_reports/

    FYI:
    My other blog is generally working:
    http://media-visions.com/globalsenseblog/feed/

    But it puts this note on top of the feed readout:

    This XML file does not appear to have any style information associated with it. The document tree is shown below.

    I tried a workaround by copping all of the php files cited by Validator (except config.php) from the functional blog to the dysfunctional blog, and that made no difference. I still get the same RSS error as at the top of this email.

    Any helpful guidance will be appreciated!

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    judahfreed: You also have the blank line problem. And nobody here can really give you any better advice than that page:

    Check your wp-config.php file for blank lines outside of <? and ?> bracketed sections.

    Check your theme's functions.php file for blank lines outside of <? and ?> bracketed sections. (unlikely if it happens on all themes)

    One by one, disable plugins and revalidate until you isolate the one causing the problem.

    That's really all there is to it. Something, somewhere, is adding blank lines to your site. It's probably a plugin or the wp-config file. But it can be any file, we have no way to help you track it down other than what you have already read.

  5. judahfreed
    Member
    Posted 6 years ago #

    Thanks for your response.

    I have been through all of the cited files, I deleted every blank line in the code on these pages, so there is code on every line, no empty lines. However, this yielded no change in the RSS failure. perhaps I did not do this process correctly?

    I also went through all of my plugins, disabling one at a time, and in no case did the RSS start functioning. Then I disabled all the plugins at once, again I still got the same CMP parsing error.

    My best hope now is to request more information, more clarification. When you say:

    Check your wp-config.php file for blank lines outside of <? and ?> bracketed sections.

    What EXACTLY am I supposed to be catching? Can you use different words to describe what I'm supposed to be finding and fixing?

    Even better, can you please post a before and after example from a php file? I tend to be a visual learner. If I can see an example, I likely can understand better.

    Thanks!

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    What EXACTLY am I supposed to be catching? Can you use different words to describe what I'm supposed to be finding and fixing?

    Look for blank lines at the beginning or end of the file.

    For the specific example of the wp-config.php file, and the plugin files, the very first characters in the file must be <?php and the very last characters must be ?>. Nothing is allowed outside of those. Nothing is allowed after the final ?>. Some text editors add blank lines to the end of files when you edit them: Use better text editors (TextPad, Notepad, etc).

    The upshot here is that when the file is parsed by PHP, it must produce no output. A blank line, a space, a carriage return, anything at all outside the <?php and ?> bits *will* produce output.

    Blank lines in the CODE don't make any difference. Blank lines outside the code sections do.

    The WordPress files that you download from here do not have any blank line problems like this in them. However, if you load them up in a crappy editor, and save them, then the editor may add such problems.

  7. judahfreed
    Member
    Posted 6 years ago #

    To help myself find where to make the correction with the blank line, I ran Feed Validator at my blog:
    http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fmedia-visions.com...
    With these results:

    Sorry
    This feed does not validate.
    *
    line 1, column 1: Blank line before XML declaration [help]
    ^

    In addition, interoperability with the widest range of feed readers
    could be improved by implementing the following recommendation.
    *
    line 47, column 1: Missing atom:link with rel="self" [help]
    </channel>
    ^

    Source: http://media-visions.com/media_reports/feed/

    1.
    2. <?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/
    2.0.2" -->
    3. <rss version="2.0"
    etc...

    MY PROBLEMS:

    1) I DO NOT HAVE ANY SUBDIRECTORY IN MY BLOG CALLED "FEED" --
    So I cannot find the file that has the blank line before the XML Declaration "<?xml version="1.0" ...."

    Please advise me on WHERE to look for this error. Which file among the dozens of php files in my blog is responsible for this line error?

    2) I am unclear which php file contains the error:

    line 47, column 1: Missing atom:link with rel="self"

    I've tried a search in TextWrangler without finding the two code strings at issue. Likely the answer is in plain sight, but I'm still a newbie. So I may be missing the obvious.

    FYI. Feed Validator said:

    Solution

    If you haven't already done so, declare the Atom namespace at the top of your feed, thus:

    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">

    Then insert a atom:link to your feed in the channel section. Below is an example to get you started. Be sure to replace the value of the href attribute with the URL of your feed.

    HOWEVER: even when I figure out (with your help) which php file to correct, I still do not know where in the file to insert the suggested code.

    Thanks for helping me.
    jf

  8. webwhat
    Member
    Posted 6 years ago #

    Oh WOW. This whole time, it was because I was typing in the feed address without the 'www'. I typed it in with the 'www' and it works perfectly, why would that make a difference?

  9. webwhat
    Member
    Posted 6 years ago #

    Also, I need to have the '/' at the end or it does not work as well.

  10. webwhat
    Member
    Posted 6 years ago #

    Weird, now it doesn't work again, even though i did not change anything.

    What are the problems with not having your feed working?

  11. youworkforthem
    Member
    Posted 6 years ago #

    I am having same issue, but with version 2.5

  12. dyampyon
    Member
    Posted 6 years ago #

    same here.
    Can't find a break line that bothering.
    Keep changing theme and keep having same problem.
    It must be from other than theme's functions.php.
    Can somebody pinpoint the location?

  13. ebizwildfire
    Member
    Posted 6 years ago #

    YEAH!!!!!

    Ok - I had added mighty ad sense code to my sidebar from the theme editor.
    I took that one line out and now my rss feed works, YEAH!

    Thank you.

    HOWEVER when I save my rss feed to an rss reader it says
    TITLE UNKNOWN

    How do I fix this?

    Thanks
    Dee

  14. dyampyon
    Member
    Posted 6 years ago #

    Hello, this is dyam again.
    If anyone using WordPress on yahoo hosting service with small business plan, kept having the same problem like mine, you need to install this from scratch. I found this url http://natespost.com/index.php/install-wordpress-on-yahoo-server/ after I posted last night. I did it so just as this page explains and my problem is solved. Thanks guys. Ciao ciao.

  15. Becca800
    Member
    Posted 6 years ago #

    I have been going crazy trying to figure this out. I even removed the xml statement and transferred it to the top line in the wp-rss2 file in php echo format, yes it still showed SEVEN lines of blank space which made absolutely no sense. I saw a post above about the www so I added it into the url and lo and behold...it works.

  16. donoterase
    Member
    Posted 6 years ago #

    For what it is worth, I have Yahoo and did their auto-install for version 2.3.3 (I was amazed they upgraded it from 2.0.2 after 2 years...) and then upgraded to 2.5.1

    I had this problem, I looked in the junk plug-ins yahoo gives you.

    Just about all of them had a blank space at the very end of the file below the closing ?>

    I removed them...and it works.

    Hope this helps someone out there.

  17. derning
    Member
    Posted 6 years ago #

    Fellas, I'm getting an XML Parsing Error as well.
    http://woomeover.com/blog/feed/

    According to FeedValidator, it seems to be related to the blank line problem:
    http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwoomeover.com%2Fblog%2F

    As recommended, I checked all the files mentioned in this post and removed all blank lines:
    http://validator.w3.org/feed/docs/error/WPBlankLine.html

    When I switch to the default theme, the RSS feed seems to work fine. How should I go about fixing this?

    Thanks in advance for any advice you can provide.

  18. Anonymous
    Unregistered
    Posted 6 years ago #

    hi. i had this error code in the feed validator result:

    This feed does not validate.

    * line 182, column 0: XML parsing error: <unknown>:182:0: junk after document element [help]

    <script type="text/javascript" language="javascript">

    i really dont know what to do on how to fix this. i checked deleted all "blank lines" and deactivated all my plugins. still it isnt working. hoping for a reply soon. thanks in advance.

    http://feedvalidator.org/check.cgi?url=http%3a%2f%2fphilippinereviewcenters.com%2ffeed%2f

    regards,
    j

  19. baalam
    Member
    Posted 6 years ago #

    Same problem here...

    Did all the steps mentioned above and nothing...

    Funny how nobody has a solution for this one

  20. Anonymous
    Unregistered
    Posted 6 years ago #

    I also had this problem, but I checked code in ALL my pages, and found a single blank line at the end of the index.php of the theme directory.

    My advice...check ALL theme and main files for blank lines outside of the php tags.

  21. baalam
    Member
    Posted 6 years ago #

    I just checked every single file on my serv and no changes

    this is what I get from w3c feed validator

    Sorry
    
    This feed does not validate.
    
        *
    
          line 1, column 1: Blank line before XML declaration [help]
    
               ^
    
        *
    
          line 38, column 2: Undefined entry element: thr:total (20 occurrences) [help]
    
              		<thr:total>0</thr:total>
                ^
  22. pkids
    Member
    Posted 5 years ago #

    I found the blank line in the "wp-feed.php" file -- it was at the very end -- highlight all the space after the last "?>" and delete it.

  23. baalam
    Member
    Posted 5 years ago #

    I had the same blank space but after fixing it nothing happened...

    Same broken feeds...

    =(

    If there is any feed expert please let me know... I wish there was a plugin that checks every file for blank spaces

  24. Doodlebug
    Member
    Posted 5 years ago #

    I'm having the same trouble:
    Checked every php file I can find for the extra spaces and no luck.

    Tried removing all plugins and switching back to default theme, but no luck.

    EDIT: I suspect this might have something to do with Permalinks not being the default. The RSS link is currently going to http://www.abletonartists.com/feed/ because Permalinks are set to 'Day And Name' (second option down in WP). My htaccess is writable though and I even updated it the manual way. The permalinks on posts etc. were fine - how can I kickstart the feed?

  25. Chris_K
    Member
    Posted 5 years ago #

    If plugins and themes didn't do it, be sure to also check wp-config.php. Remember, not just spaces but empty lines as well. Nothing should be before the opening <?php nor after the file's final ?>

  26. Doodlebug
    Member
    Posted 5 years ago #

    Trust me i've gone through EVERY php file (see edit above though).

    Weird thing was though - every file had an extra line after the closing ?> - why would this be? I didn't open or edit any of these files and uploaded them as is from the default download.

  27. onetime
    Member
    Posted 5 years ago #

    I spent countless hours looking for blank lines and deleting a few here and there.

    Then I noticed that the links to my RSS feeds were being generated as http://pepperspray.me/feed/ (notice the trailing slash at the end). In order for the feed to work correctly, it should be generated as http://pepperspray.me (no trailing slash at the end).

    I went into my admin, and checked out my permalink settings. I removed the trailing slash from my custom permalink structure, and voila! My feed works like a charm now.

    I don't know if this helps you out or not, but it worked wonders for me.

  28. onetime
    Member
    Posted 5 years ago #

    Correction:

    The last sentence of the second paragraph should read:

    In order for the feed to work correctly, it should be generated as http://pepperspray.me/feed (no trailing slash at the end).

    Sorry 'bout that.

  29. Doodlebug
    Member
    Posted 5 years ago #

    Hey, thanks for the suggestion.

    I did have trailing slash, and updated my permalinks accordingly - but no luck. :(

  30. baalam
    Member
    Posted 5 years ago #

    What about something like this

    Let me know what you think

Topic Closed

This topic has been closed to new replies.

About this Topic