Web Design Blog

This is where we store some of our Web Development thoughts, tips and tricks, just because we like to share.

WordPress RSS Feed Is Empty [Bug Fix]

Bug FixI recently upgraded BrightCherry‘s wordpress version from 2.3 to 2.5. As soon as I did that I noticed our RSS feed stopped working. Hmm…strange.

I Googled around and I couldn’t find much on the issue. I found one discussion over at WordPress Trac; where someone else had also experienced the same issue.

However, I don’t know if it’s just me, but I found that discussion beyond difficult to digest. It’s formatted in such a weird way, and everyone is talking in riddles and out of sync. After having spent 30mins trying to work out what the contributors were talking about, I eventually managed to untangle their code and walk away with a fix.

The Problem
Certain rewrite rules were changed in the 2.5 version, so a lot of people that have their blog contained in a sub-dir are only likely to suffer from this problem. For example, if you’re blog is located in http://www.example.com, you should be fine. But if you’re blog is stored in htttp://www.example.com/blog/, you may suffer from this weird empty RSS feed condition.

I’m not entirely sure how wide spread this issue is, but it happened to us, and this is how I fixed it…

The Fix
I downloaded the complete WordPress 2.5 zip file again. I then modified rewrite.php
File location: wp-includes/rewrite.php

From line 809 – 814, you’ll need to modify the following:

From:

$default_feeds = array(
'.*wp-atom.php$'=>$this->index .'?feed=atom',
'.*wp-rdf.php$' => $this->index .'?feed=rdf',
'.*wp-rss.php$' => $this->index .'?feed=rss',
'.*wp-rss2.php$' => $this->index .'?feed=rss2',
'.*wp-feed.php$' => $this->index .'?feed=feed',
'.*wp-commentsrss2.php$' => $this->index . '?feed=rss2&withcomments=1');
[/pre]

To:

$default_feeds = array(
'.*/wp-atom.php$'=>$this->index .'?feed=atom',
'.*/wp-rdf.php$' => $this->index .'?feed=rdf',
'.*/wp-rss.php$' => $this->index .'?feed=rss',
'.*/wp-rss2.php$' => $this->index .'?feed=rss2',
'.*/wp-feed.php$' => $this->index .'?feed=feed',
'.*/wp-commentsrss2.php$' => $this->index . '?feed=rss2&withcomments=1');
[/pre]

The only change was the forward slash (/) after the *. See it? Good.

After that, I uploaded all the WordPress version 2.5 files again (including the newly modified rewrite.php file). Then I run /wp-admin/upgrade.php

Bingo! That seemed to fix the problem, and now our RSS feed is working once again.

Has anyone else suffered from this problem, and did this fix help? Let us know.

22 Jul 2008 / 10 Comments / Wordpress / by Maruf

10 Comments

  1. NeoSwf
    06/08/2008
    1

    Hey.
    I’m having problems with my rss feed myself. For some reason it stopped working. I run wp2.2.2 and my blog sits on the domain itself and not in a subfolder. any ideas?

  2. Maruf
    07/08/2008
    2

    Hey Neo,
    What’s the url of your blog?

  3. Clayton Narcis
    19/09/2008
    3

    Great fix. Sorted out my RSS problem

  4. Michelle Reader
    05/02/2009
    4

    Hello,
    I tried this but my RSS still isn’t working. Think it’s a bug with 2.7, lots of people having RSS problems it seems. Any ideas?
    http://www.michelle-reader.co.uk/Blog

  5. Maruf
    05/02/2009
  6. Michelle Reader
    05/02/2009
    6

    So it is!
    Thanks

  7. chitgoks
    10/06/2009
    7

    me too, having probs. my http://url/feed returns blank

    if i register it in feedburner it says An error occurred connecting to the URL: Error getting URL: 500 – Internal Server Error

    totally clueless here

  8. Marco
    04/08/2009
    8

    Hee

    Great job.. it works again..
    Had to problem in all of a sudden.

    Marco

  9. Katherine
    17/01/2010
    9

    Thank you SO much! I ran into the problem when I upgraded to version 2.9.1. I couldn’t find anything helpful online until I found your post.

    I added the / like you suggested, re-uploaded just that one file, and ran the upgrade.php file. And it worked! My RSS is back up and running.

  10. Svante
    15/05/2010
    10

    Same problem. Had to fix some of my posts so that the blog.url/feed -> VALID (http://feedvalidator.org/)

Leave a Reply

© 2012 BrightCherry :)