Website Spec
← Foundations
Recommended

Feed discovery with rel=\"alternate\"

If your site publishes a feed — RSS, Atom, or JSON Feed — announce it in <head> with <link rel=\"alternate\">. Feed readers, agents, and browsers discover it without guessing the URL.

What it is

<link rel="alternate"> in <head> declares an alternative representation of the current page or site — most commonly a syndication feed, but also a translated version, a print stylesheet, or, increasingly, the page's Markdown source. Feed readers, browsers, and a growing number of AI agents look for these links to subscribe, switch language, or fetch a machine-friendly version.

For feeds specifically:

<head>
  <link rel="alternate" type="application/rss+xml"
        title="Example — Posts" href="/feed.xml">
  <link rel="alternate" type="application/atom+xml"
        title="Example — Posts (Atom)" href="/atom.xml">
  <link rel="alternate" type="application/feed+json"
        title="Example — Posts (JSON Feed)" href="/feed.json">
</head>

The browser, feed readers, and tools like the W3C Feed Validation Service pick these up automatically. The title attribute is what the user sees in the subscribe UI — make it specific.

Why it matters

How to implement

Pick the right MIME type. Browsers and readers branch on it.

| Format | MIME type |

|---|---|

| RSS 2.0 | application/rss+xml |

| Atom 1.0 | application/atom+xml |

| JSON Feed | application/feed+json |

| Markdown source | text/markdown |

Include title for every alternate. A reader's subscribe dialog shows the title verbatim. "RSS Feed" tells the user nothing; "Example — Engineering blog" does.

Put the most-preferred feed first. Some readers offer the first alternate by default if there are several.

Use absolute URLs in the feed itself, even if the href here is relative — see machine-readable formats.

Site-wide vs page-specific. A blog index links to the main feed. An individual category page can additionally link to that category's feed. An individual post does not need its own feed.

Don't forget HTTP discovery. Some readers also honour Link headers:

Link: </feed.xml>; rel="alternate"; type="application/rss+xml"; title="Example — Posts"

Useful for non-HTML responses (e.g. an API root) where there is no <head>.

Common mistakes

Verification

Sources