Introduction to Feeds
A feed is a function of special software that allows Feedreaders to access a site automatically looking for new content and then posting the information about new content and updates to another site. This provides a way for users to keep up with the latest and hottest information posted on different blogging sites.
There are several different kinds of feeds, read by different Feedreaders. Some feeds include RSS (alternately defined as "Rich Site Summary" or "Really Simple Syndication"), Atom or RDF files.
WordPress Built-in Feeds
By default, WordPress comes with various feeds. They are generated by template tag for bloginfo()
? for each type of feed and are typically listed in the sidebar and/or footer of most WordPress Themes. They look like this:
- URL for RDF/RSS 1.0 feed
<?php bloginfo('rdf_url'); ?>- URL for RSS 0.92 feed
<?php bloginfo('rss_url'); ?>- URL for RSS 2.0 feed
<?php bloginfo('rss2_url'); ?>- URL for Atom feed
<?php bloginfo('atom_url'); ?>- URL for comments RSS 2.0 feed
<?php bloginfo('comments_rss2_url'); ?>
The first four feeds display recent updates and changes to your site's content for the different feedreaders. Of these, the RSS feeds are the most well known. The last feed example is used by RSS 2.0 feedreaders and does not show your site's content. It only shows the comments made on your site.
To track the comments on a specific post, the comments_rss_link()
? template tag is used on single post pages like this:
<?php comments_rss_link('RSS 2.0'); ?>
There are ways to modify these feeds, and these are covered in the article on Customizing Feeds ?.
Finding Your Feed URL
There are times when you want to tell someone your site's feed address or URL, or you need it to submit it to search engines and directories, many of which now accept feed URL submissions. There are four possible URLs for each of your feeds. Any of these will work.
http://example.com/wp-rss.php
http://example.com/wp-rdf.php http://example.com/wp-atom.php
Or you can access them like this:
http://example.com/?feed=rss http://example.com/?feed=rss2 http://example.com/?feed=rdf http://example.com/?feed=atom
If you are using custom permalinks ?, you should be able to reach them through this usage:
http://example.com/feed/ http://example.com/feed/rss/ http://example.com/feed/rss2/ http://example.com/feed/rdf/ http://example.com/feed/atom/
You can also provide feeds to only specific categories on your site by adding the following to the end of the link:
http://example.com/wp-rss2.php?cat=42
Adding Feeds
Not all WordPress Themes feature all of the RSS Feed types that are available through WordPress. To add a feed to your site, find the location of where the other feeds are, typically in your sidebar.php or footer.php template files of your Theme. Then add one of the tags listed above to the list, like this example:
<div style="border:1px solid darkslateblue;padding: 5px; background: #f0f0f0"> <tt><li><br /> <a href="feed:<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?></a> <br /></li><br /><br /> <li><br /> <a href="feed:<?php bloginfo('atom_url'); ?>" title="<?php _e('Syndicate this site using Atom'); ?>"><?php _e('Atom'); ?></a><br /> </li><br /><br /> <li> <br /><a href="feed:<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a><br /> </li></tt> </div>
Adding Graphics to Feed Links
Attach:rssfeed.gif|right|RSS feed icon button]]Many people like to have a graphic representing the feed instead of words. There is talk of having standards for these graphics or "buttons", but currently, you can [[http://kalsey.com/tools/buttonmaker/ | make your own to match the look and colors on your site.
To add a graphic to your feed link, simply wrap the link around the graphic such as:
<div style="border:1px solid darkslateblue;padding: 5px; background: #f0f0f0"> <tt><a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><br /> <img src="http://example.com/images/rssfeed.gif" alt="RSS Feed" title="RSS Feed" /><br /> </a> </tt></div>
Subscribe Me allows you to easily add various subscription buttons to your sidebar.
Changing Addresses
If you are currently using other webblog software and are changing to WordPress, or are moving your weblog to a new location, you can "forward" RSS readers to your new RSS feeds using file rewrites and redirects in your .htaccess file.
Edit the .htaccess file in your root folder, if no file exists, create one.
Here is an example for a b2 feed:
RewriteRule ^b2rss2.php(.*)? /wordpress/?feed=rss2 [QSA]
Here is an example for MovableType Users:
RewriteRule ^index.xml(.*)? /wordpress/?feed=rss2 [QSA]
Feed Director provides rewrite rules for common feed filenames used by other blogging platforms, such as index.xml, index.rdf, rss.xml, rss2.xml, atom.xml, *.xml, via an easy-to-use "install it and forget it" plugin.
More Information and Resources
- Customizing Feeds ?
- Syndication plugins ?
- How to add an image to your RSS 2.0 feed
- Mezzoblue's What is RSS/XML/Atom/Syndication?
- NewsForge: Save time with syndication
- Feed Icons - Help establish the new standard
- Kalsey's Button Maker - Custom Feed Icons
- 80x15 Brilliant Button Maker
- Glassy Button Maker
- Online Button Maker