Support » Fixing WordPress » CNN.COM RSS feed not working with WP RSS widget

  • Resolved MarkRH


    For some odd reason, the CNN.COM Top Stories RSS Feed stopped working with my blog’s RSS Feed widget. It just says: “
    * An error has occurred; the feed is probably down. Try again later.”

    However, I can manually browse to the URL and it shows fine.

    The NASCAR and Planetary Society RSS feeds still come in fine. Anyone else seeing this? My guess is CNN changed something on their end to maybe cause parsing errors. My blog is at

    I just added their Technology Feed and it produces the same error.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Well, it works on a locally hosted blog on my PC. So, there might be a network connectivity issue between my Webhost and CNN or CNN is blocking the IP address/range where my website is hosted. Hmmm…

    I can connect to my webhost server via SSH and am able to ping fine. So.. I dunno hmmm.

    Using my own RSS parsing script, it will work fine locally; however, when running it at the webhost, I get the following error: “XML error: not well-formed (invalid token) at line 7”

    Both are running PHP 5.2.6. CNN is not blocking my webhost, but something has changed on the server and/or at CNN causing parsing problems. Since my own script is having problems as well, this doesn’t appear to be a WordPress only issue, although, they are most likely using the same or similar XML parsing functions.


    I found out the following line is the culprit (at least with my script):

    <copyright>© 2008 Cable News Network LP, LLLP.</copyright>

    If I replace the copyright symbol “©” with the word “Copyright” before sending it through the parser, then it works without error. So, it looks like I’ll need to find where the code in WordPress is that handles the RSS widget and do the same. My PHP error log is full of that same XML error so I suspect this is what’s generating it.

    I got it working with the Top Stories RSS Feed. The Technology one still doesn’t work. To get it to work with the Top Stories feed, I had to add a line in the /wp-includes/rss.php file:

    function _response_to_rss ($resp) {
       // begin my additions
       @$resp->results = str_replace("©","Copyright",$resp->results);
       // end my additions
       $rss = new MagpieRSS( $resp->results );

    Thought I would follow-up in case anyone finds this in a search.. part of the problem I realized was that the RSS Widget caches the RSS output for 1 hour by default before checking again.. so any code changes are not readily apparent because it’s just sending what’s stored in the cache. So, in the same RSS.PHP file, look for the following:

    if ( !defined('MAGPIE_CACHE_ON') ) {
    		define('MAGPIE_CACHE_ON', 1);

    Change that 1 to a 0 so it doesn’t use the cache and you see immediate results to your code changes. My Nascar feed also stopped working and had to further modify the code to this:

    function _response_to_rss ($resp) {
       // begin my additions
       $resp->results = str_replace("©","Copyright",$resp->results);  // to fix Nascar feed
       $resp->results = str_replace("©","Copyright",$resp->results); // to fix CNN feeds
       //echo $resp->results;
       // end my additions
    	$rss = new MagpieRSS( $resp->results );

    Hope it helps.
    Mark H.

    Mark, I am having the exact same problem. However, I don’t know where to start to edit the code. Which page is that located under? index.php?

    As mentioned in bold above, everything is in /wp-includes/rss.php

    The Magpie variable definitions are within the init() function.

    Anyone had any luck using iTunes affiliate RSS feeds:

    Try this one – all I get is errors – if there is anyone out there who can get this to work, please post:*v0oJgqDc%26offerid%3D146261%26type%3D3%26subid%3D0%26tmpid%3D1826%26RD_PARM1%3D

    You can copy/paste that long URL and it works fine, you can click the link in a browser, and it loads in Google Reader or other RSS aggregreators.

    I’ve installed KB Advanced RSS, Magpie RSS plugin, etc … regardless of what I do, I’m getting this error.

    I kinda doubt it’s my webhost, because if I add my feedburner RSS feed address into either KBB or RSS widget, it parses just fine.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘CNN.COM RSS feed not working with WP RSS widget’ is closed to new replies.