WordPress RSS Feed Is Empty [Bug Fix]

Image frame
WordPress RSS Feed Is Empty [Bug Fix]
Maruf
Jul 22nd, 2008
Maruf scribbled this post.

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.


Filed away: Wordpress

comments

Image frame
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?

NeoSwf
Aug 6th, 2008
Image frame
2

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

Maruf
Aug 7th, 2008
Image frame
3

Great fix. Sorted out my RSS problem

Clayton Narcis
Sep 19th, 2008
Image frame
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

Michelle Reader
Feb 5th, 2009
Image frame
Maruf
Feb 5th, 2009
Image frame
6

So it is!
Thanks

Michelle Reader
Feb 5th, 2009
Image frame
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

chitgoks
Jun 10th, 2009
Image frame
8

Hee

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

Marco

Marco
Aug 4th, 2009
Image frame
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.

Katherine
Jan 17th, 2010
Image frame
10

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

Svante
May 15th, 2010

feel free to leave a scribble

Name:
Email:
gravatar
Want an image next to your comments?
visit gravatar.com
Message:
Get a free quote