Summary: Add html-header links for auto-discovery of rss/atom feeds
Version: 0.03 (2006-03-19)
Status: Stable
Prerequisites: pmwiki-2.0
Maintainer: Hagan
Discussion: FeedLinks-Talk
Categories: RSS
Votes: 5


How can I add links that will enable autodiscovery of my site's Atom and/or RSS feeds?


The feedlinks.phpΔ script adds RSS and Atom feed link tags in your pages' HTML Headers. Typical feed links look like this:

<link rel='alternate' title='Your Site : Main - RSS Feed'
    type='application/rss+xml' />
<link rel='alternate' title='Your Site : Main - Atom Feed'
    type='application/atom+xml' />


Download feedlinks.phpΔ and place it to your cookbook/ directory, then insert the following line in your local/config.php file:



By default the script will produce RSS 2.0 and Atom links the site-wide AllRecentChanges page ($SiteGroup/AllRecentChanges). If you want to override the defaults you can pass settings to the script.

For example, to advertise RSS 2.0 feeds by group, use

## Enable the feedlinks recipe, which adds HTML header links that enable
## "autodiscovery" of the site's Atom and/or RSS web feeds.
$EnableSitewideFeed = 0;
$EnableRssLink  = 1;
$EnableAtomLink = 0;
include_once("$FarmD/cookbook/feedlinks.php");  # RSS 2.0 feeds by group

or to advertise RSS and Atom links to a sitewide feed at Main/AllRecentChanges instead of the default $SiteGroup/AllRecentChanges, use

## Enable the feedlinks recipe;  Sitewide RSS 2.0 and Atom Feeds
$FeedLinkSourcePath = 'Main/AllRecentChanges';


SteP 2009-09-14: I think the code needs changing to support setting feed source and title on a per-group basis. Replace these two lines

  $FeedLinkSourcePath = '$[$Group/RecentChanges]';
  $FeedLinkTitleGroup = ' : $[$Group] -';


  SDV($FeedLinkSourcePath, '$[$Group/RecentChanges]');
  SDV($FeedLinkTitleGroup, ' : $[$Group] -');


  • 2006-01-13: Version 0.01 (Initial release)
  • 2006-01-15: Version 0.02
  • 2006-03-19: Version 0.03 Now can be run multiple times with setting changes in between.

See Also


  • Hagan 2006-01-13 Created the recipe on a suggestion by HansB.


See discussion at FeedLinks-Talk

User notes +2: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.