Linking An RSS Or Atom Feed to a HTML Document

20th December 2007

Adding a hyper link for an RSS or Atom feed on your web page works, but that's not all you can do. By adding a link to the head section of the page you can allow your users an alternative method of picking up your feed.

To add an RSS feed use this.

<link rel="alternate" type="application/rss+xml" href="http://www.example.com/rssfeed.xml" />

To add an Atom feed use this.

<link rel="alternate" type="application/atom+xml" href="http://www.example.com/blog/wp-atom.php" />

These are both XHTML examples. To do this in HTML just remove the slash on the right hand side like this.

  1. <link rel="alternate" type="application/rss+xml" href="http://www.example.com/rssfeed.xml" />
  2. <link rel="alternate" type="application/atom+xml" href="http://www.example.com/JustBlog/wp-atom.php" />

You can add more than one link attribute to a page with no ill effects. If you provide multiple feeds most modern browsers will give you a list of feeds to select from.

Add new comment

The content of this field is kept private and will not be shown publicly.