Linking An RSS Feed to a HTML Document

20 December, 2007 | (X)HTML

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/JustBlog/wp-atom.php" />

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

<link rel="alternate" type="application/rss+xml" href="http://www.example.com/rssfeed.xml" />
<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. Most modern browsers will give you a list of feeds to select from.

Write a comment