{"slug": "feed-discovery-with-rel-alternate", "title": "Feed discovery with rel=\"alternate\"", "summary": "Websites should announce RSS, Atom, or JSON feeds using <link rel=\"alternate\"> in the <head> to enable automatic discovery by feed readers, browsers, and AI agents. The practice improves subscription rates and ensures machine-readable versions are easily found.", "body_md": "# Feed discovery with rel=\"alternate\"\n\nIf 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.\n\n## What it is\n\n`<link rel=\"alternate\">`\n\nin `<head>`\n\ndeclares 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.\n\nFor feeds specifically:\n\n```\n<head>\n  <link rel=\"alternate\" type=\"application/rss+xml\"\n        title=\"Example — Posts\" href=\"/feed.xml\">\n  <link rel=\"alternate\" type=\"application/atom+xml\"\n        title=\"Example — Posts (Atom)\" href=\"/atom.xml\">\n  <link rel=\"alternate\" type=\"application/feed+json\"\n        title=\"Example — Posts (JSON Feed)\" href=\"/feed.json\">\n</head>\n```\n\nThe browser, [feed readers](https://en.wikipedia.org/wiki/Comparison_of_feed_aggregators), and tools like the [W3C Feed Validation Service](https://validator.w3.org/feed/) pick these up automatically. The `title`\n\nattribute is what the user sees in the subscribe UI — make it specific.\n\n## Why it matters\n\n**Feed readers cannot subscribe to what they cannot find.** Without`<link rel=\"alternate\">`\n\n, the user has to know the URL. With it, every modern reader auto-discovers from the homepage or any article.**Browsers and OS-level readers (Safari, NetNewsWire, Reeder) use the same discovery hook.****Search engines and aggregators** treat`rel=\"alternate\"`\n\nas the canonical signal for syndication.Pair the same pattern with`rel=\"alternate\"`\n\nis a multi-purpose link relation.`hreflang`\n\nfor translated URLs (see[hreflang](/spec/i18n/hreflang/)), with`type=\"text/markdown\"`\n\nfor[Markdown source endpoints](/spec/agent-readiness/markdown-source-endpoints/), and with`media`\n\nfor print or mobile alternates. Using it consistently teaches every tool that reads your site what to look for.\n\n## How to implement\n\n**Pick the right MIME type.** Browsers and readers branch on it.\n\n| Format | MIME type |\n|---|---|\n| RSS 2.0 | `application/rss+xml` |\n| Atom 1.0 | `application/atom+xml` |\n| JSON Feed | `application/feed+json` |\n| Markdown source | `text/markdown` |\n\n**Include title** for every alternate. A reader’s subscribe dialog shows the title verbatim. “RSS Feed” tells the user nothing; “Example — Engineering blog” does.\n\n**Put the most-preferred feed first.** Some readers offer the first alternate by default if there are several.\n\n**Use absolute URLs in the feed itself**, even if the `href`\n\nhere is relative — see [machine-readable formats](/spec/agent-readiness/machine-readable-formats/).\n\n**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.\n\n**Don’t forget HTTP discovery.** Some readers also honour `Link`\n\nheaders:\n\n```\nLink: </feed.xml>; rel=\"alternate\"; type=\"application/rss+xml\"; title=\"Example — Posts\"\n```\n\nUseful for non-HTML responses (e.g. an API root) where there is no `<head>`\n\n.\n\n## Common mistakes\n\n- Using\n`type=\"text/xml\"`\n\nor`application/xml`\n\nfor an RSS feed. Some readers ignore it. - Linking to a feed that 404s, redirects, or fails validation. Run\n`https://validator.w3.org/feed/`\n\non every feed URL before shipping. - Pointing all\n`<link rel=\"alternate\">`\n\nentries at the same URL “to be safe”. Each entry must describe a distinct representation. - Omitting\n`title`\n\nand letting the reader guess. - Putting\n`rel=\"alternate\"`\n\non an`<a>`\n\nlink in the body. It only carries discovery semantics inside`<head>`\n\n.\n\n## Verification\n\n`curl -s https://example.com/ | grep -i 'rel=\"alternate\"'`\n\nreturns each declared alternate.- Paste the homepage URL into a feed reader’s “Add subscription” dialog — it should resolve to the correct feed without you typing the feed URL.\n- The W3C\n[feed validator](https://validator.w3.org/feed/)returns no errors on the linked feed. - View source on a per-language page and confirm\n`rel=\"alternate\" hreflang=\"…\"`\n\nsiblings sit alongside any feed alternates without conflicting.\n\n## Related topics\n\n## Sources & further reading\n\n-\n[HTML Living Standard — Link types: alternate](https://html.spec.whatwg.org/multipage/links.html#link-type-alternate)— WHATWG -\n[MDN — rel=alternate](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel#alternate)— MDN -\n[RSS 2.0 Specification](https://www.rssboard.org/rss-specification)— RSS Advisory Board -\n[RFC 4287 — The Atom Syndication Format](https://www.rfc-editor.org/rfc/rfc4287)— IETF -\n[JSON Feed 1.1](https://www.jsonfeed.org/version/1.1/)— JSON Feed", "url": "https://wpnews.pro/news/feed-discovery-with-rel-alternate", "canonical_source": "https://specification.website/spec/foundations/feed-discovery/", "published_at": "2026-06-18 00:00:00+00:00", "updated_at": "2026-06-18 21:05:37.106237+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["RSS", "Atom", "JSON Feed", "W3C Feed Validation Service", "Safari", "NetNewsWire", "Reeder"], "alternates": {"html": "https://wpnews.pro/news/feed-discovery-with-rel-alternate", "markdown": "https://wpnews.pro/news/feed-discovery-with-rel-alternate.md", "text": "https://wpnews.pro/news/feed-discovery-with-rel-alternate.txt", "jsonld": "https://wpnews.pro/news/feed-discovery-with-rel-alternate.jsonld"}}