Proper XML feeds in wordpress

This week I was asked to fix the default RSS output in WordPress. I soon found out all I needed were two XML plugins and to use RSS2 or atom feeds to force the full text of the article and removes any content:encoded tags. The default RSS only displays a summary of the article with no images.

First, we have to change all RSS links to RSS2 or ATOM links. RSS is old anyhow, so there is no real need for it anymore so stick with RSS2. For example I was using example.com/feed/rss/ , but now I will use example.com/feed/rss2/ . Keep in mind I am using permalinks.

Now we need to make a new plugin file. Both plugins are basic php, and I put them both in the same file to keep things simple. Call it anything you like.

The first plugin is called completeRSS, and can be found here: http://neosmart.net/dl.php?id=2 . This plugin is simple yet very nice. It forces all your feeds to display the full text of every article, not just a small summary, and also does not use any of the abused content:encode tags which can cause many bugs and problems on various feed systems.

The second plugin is called absoluteRSS, and can be found here: http://robert.accettura.com/projects/absoluterss/ . This plugin is even simpler than the last, but still important. This just converts relative URI’s to absolute. This was required to display images from any external source, like feedburner.com. Also I had to change some code because I had my wordpress installed on /home/ , but the end user does not see that so my install and wp directory are different, thus the wrong variable was used. So on line 91, use get_settings(‘home’) instead.

Now that you have a proper RSS2 feed setup, we can put services like FeedBurner.com to use. You will notice the ‘sindicate’ button at the bottom of be left sidebar. Click the link and notice the feed is provided in every format through FeedBurner, which is a free service. This is an option in your feed settings called “Smart Feed”.