Skip to content
Tutorials

RSS, Atom and JSON Feed: Choosing a Format, Minimal Valid Feeds, Autodiscovery and Validation

AIDToolStack EditorialNovember 7, 20268 min read
RSSAtomJSON FeedSyndicationXML
Share:Twitter

A reader emails to say your feed shows every post as new again, all forty of them, right after you changed hosting. Or their reader can't find a feed at all, even though /feed.xml exists. Feeds are an old, quiet technology and they mostly just work, but the failures are specific: IDs that changed, dates in the wrong format, a missing discovery tag, HTML that broke the XML.

This post compares the three formats still in use (RSS 2.0, Atom and JSON Feed), gives a minimal valid example of each, covers autodiscovery, and ends with how to validate and serve a feed without hammering your server. The specs referenced are current as of November 2026.

Which format to publish

RSS 2.0AtomJSON Feed
SpecRSS 2.0.11, RSS Advisory Board, 2009RFC 4287, IETF Standards Track, December 2005Version 1.1, August 2020
SyntaxXML, no namespace for core elementsXML, http://www.w3.org/2005/Atom namespaceJSON
DatesRFC 822 (Sat, 07 Sep 2002 00:00:01 GMT)RFC 3339 (2026-11-07T09:00:00Z)RFC 3339
Required IDsNone; guid is optionalid on feed and every entryid on every item
Body markupEntity-encoded HTML allowed in descriptiontype="text", "html" or "xhtml"content_html or content_text
Media typeapplication/rss+xml (autodiscovery spec)application/atom+xmlapplication/feed+json

My default is Atom. It's the only one of the three with an IETF standard behind it, it forces you to have stable IDs and an updated timestamp, and its date format is the same RFC 3339 your code already produces. RSS 2.0 is fine and more widely recognised by name; if a client or podcast platform asks for RSS, give it RSS. JSON Feed is pleasant to generate, but I wouldn't publish it alone, because the RSS and Atom readers people already use are the safer bet. You can publish more than one from the same data, but advertise only your main one (more on that below).

Field mapping across RSS 2.0.11, Atom and JSON Feed 1.1: channel, feed and top-level object; item, entry and items; guid, id and id; date formats and media types
Field mapping across RSS 2.0.11, Atom and JSON Feed 1.1: channel, feed and top-level object; item, entry and items; guid, id and id; date formats and media types

A minimal valid Atom feed

RFC 4287 requires exactly one id, title and updated on the feed and on each entry. The feed also needs an author unless every entry has one, and each entry needs either content or a link rel="alternate". It says feeds SHOULD include a rel="self" link pointing at the feed's own URL.

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>https://example.com/</id>
  <title>Example Engineering Blog</title>
  <updated>2026-11-07T09:00:00Z</updated>
  <author><name>Example Engineering</name></author>
  <link rel="self" href="https://example.com/feed.xml" />
  <link rel="alternate" href="https://example.com/blog/" />

  <entry>
    <id>tag:example.com,2026:rotating-api-keys</id>
    <title>Rotating API Keys Without Downtime</title>
    <link rel="alternate" href="https://example.com/blog/rotating-api-keys" />
    <published>2026-11-07T09:00:00Z</published>
    <updated>2026-11-07T09:00:00Z</updated>
    <summary>A two-key overlap pattern for rotating API keys safely.</summary>
    <content type="html">&lt;p&gt;Rotate keys by running two at once&amp;hellip;&lt;/p&gt;</content>
  </entry>
</feed>

Note the entry id. The RFC says it must be a permanent, universally unique IRI and that it "MUST NOT change" even if the document is relocated. Using the post URL as the ID is common and works until you change domains or URL structure, at which point every reader sees every post as new. A tag: URI built from the domain, a year and the slug avoids that; RFC 4151 even lists Atom as a user of such identifiers. Whatever you pick, generate it once and store it with the post.

Dates in Atom need an uppercase T and either a numeric offset or an uppercase Z. 2026-11-07 09:00:00 is invalid.

The RSS 2.0 equivalent

The RSS spec requires title, link and description on the channel. Each item can have any elements, but "at least one of title or description must be present."

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Example Engineering Blog</title>
    <link>https://example.com/blog/</link>
    <description>Notes from the Example engineering team.</description>
    <ttl>60</ttl>
    <item>
      <title>Rotating API Keys Without Downtime</title>
      <link>https://example.com/blog/rotating-api-keys</link>
      <guid isPermaLink="false">tag:example.com,2026:rotating-api-keys</guid>
      <pubDate>Sat, 07 Nov 2026 09:00:00 GMT</pubDate>
      <description><![CDATA[<p>Rotate keys by running two at once&hellip;</p>]]></description>
    </item>
  </channel>
</rss>

Two details people miss. First, isPermaLink defaults to true, which tells readers the guid is a URL they can open. If your guid isn't a URL, set it to false explicitly. Second, ttl is in minutes: it tells readers how long they may cache the channel. RSS has no item-level "last modified" element, so an edited post looks the same as an unedited one unless the reader compares content.

JSON Feed, briefly

JSON Feed 1.1 requires version, title and items, and each item needs an id plus content_html or content_text. home_page_url and feed_url are "optional but strongly recommended", and the spec says public feeds should treat them as required.

{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "Example Engineering Blog",
  "home_page_url": "https://example.com/blog/",
  "feed_url": "https://example.com/feed.json",
  "authors": [{ "name": "Example Engineering" }],
  "items": [
    {
      "id": "tag:example.com,2026:rotating-api-keys",
      "url": "https://example.com/blog/rotating-api-keys",
      "title": "Rotating API Keys Without Downtime",
      "content_html": "<p>Rotate keys by running two at once…</p>",
      "date_published": "2026-11-07T09:00:00Z"
    }
  ]
}

Version 1.1 replaced the singular author with an authors array; the spec says new feeds should use authors even for one person. It also clarified that id is a string, so don't emit a bare number. Run the file through our JSON Formatter if you're hand-editing; it reports the line and column of a parse error.

Autodiscovery: let readers find the feed

Readers and browser extensions look for a <link> in the page's <head>:

<link rel="alternate" type="application/atom+xml"
      title="Example Engineering Blog" href="https://example.com/feed.xml" />

Use application/rss+xml for RSS and application/feed+json for JSON Feed. The rules, from the RSS autodiscovery spec and the HTML standard:

  • It must be a <link> in <head>. A visible <a href="/feed.xml"> is nice for humans, but the HTML standard says anchor elements aren't used for feed autodiscovery.
  • When there are several, the HTML standard says the first in document order should be the default.
  • The RSS Board recommends one link per page and says publishers offering the same content in several formats shouldn't advertise all of them. Advertise the main feed; link the others from an about page if you like.
  • Use full URLs. Relative ones are allowed but the spec notes some software ignores <base>.

Add it to every page template, not only the home page. Someone pasting a post URL into a reader should still find the feed.

Sequence: a feed reader fetches the HTML page, finds the alternate link, fetches the feed and gets an ETag, then polls with If-None-Match and receives 304 Not Modified; optionally it subscribes to a WebSub hub that pushes updates
Sequence: a feed reader fetches the HTML page, finds the alternate link, fetches the feed and gets an ETag, then polls with If-None-Match and receives 304 Not Modified; optionally it subscribes to a WebSub hub that pushes updates

Serving it politely

Feed readers poll on a schedule, and every subscribed reader does it independently, so make unchanged polls cheap. Send an ETag or Last-Modified header with the feed. Readers that support conditional requests send If-None-Match or If-Modified-Since back, and if nothing changed you answer 304 Not Modified with no body (MDN on conditional requests). Our HTTP caching headers guide covers how CDNs handle those validators if the feed sits behind one.

If you'd rather push than be polled, WebSub is the W3C Recommendation for it, republished on 2 June 2026 with added XSS mitigations in its security section. You advertise a hub with rel="hub" and your feed's canonical URL with rel="self", either as HTTP Link headers or as <link> elements inside the feed, and you notify the hub when the feed changes. The spec leaves the notification mechanism to each hub. Google's sitemap docs also mention WebSub as the way to tell search engines about Atom or RSS changes, and Google accepts RSS and Atom feeds as sitemaps, though they only cover recent URLs.

Serve feeds with their real media types. Atom is application/atom+xml per the RFC, JSON Feed asks for application/feed+json.

Validating before readers complain

The W3C Feed Validation Service checks Atom and RSS, either by URL or by pasting the XML. Run it on the deployed URL, since that also catches a server sending HTML error pages or the wrong content type.

The common failures it reports are predictable:

  • Unescaped HTML in XML. A raw <p> or &nbsp; inside <description> breaks the document. Wrap HTML in CDATA as above, or entity-encode it; the XML Escape tool does the latter for a snippet. Note that a literal ]]> inside your content ends a CDATA section early.
  • Named HTML entities. XML only knows &amp;, &lt;, &gt;, &quot; and &apos;. &hellip; outside CDATA or escaped markup is a fatal error.
  • Relative links in content. <img src="/img/a.png"> breaks in a reader that doesn't resolve against your site. Rewrite to absolute URLs when generating the feed.
  • Wrong date format. RFC 822 in RSS, RFC 3339 in Atom and JSON Feed. Mixing them up is an easy slip in a hand-rolled generator.
  • Changing IDs. No validator can catch this one. It's the cause of the "everything is new again" email.

To eyeball a feed's structure, the XML Formatter pretty-prints it after checking that it's well-formed, and names the line of a mismatched or unclosed tag. Well-formed isn't the same as a valid feed, so use the W3C validator for the final word.

Feed checklist

  1. Pick one primary format (Atom unless someone needs RSS) and advertise only that one with a <link rel="alternate"> on every page.
  2. Give every entry a permanent ID that isn't tied to the current URL, and store it.
  3. Use the right date format for the format.
  4. Escape or CDATA-wrap HTML content, and make every URL in it absolute.
  5. Include rel="self" in Atom and feed_url in JSON Feed.
  6. Serve the real media type with an ETag or Last-Modified, and answer conditional requests with 304.
  7. Run the deployed URL through the W3C validator after every template change.
AE

Written by AIDToolStack Editorial

Researched from official documentation, specifications and vendor pages, listed under Sources below. Last checked November 2026.

Sources

  1. www.rssboard.org/rss-specification
  2. www.rfc-editor.org/rfc/rfc4287.html
  3. www.jsonfeed.org/version/1.1/
  4. www.rssboard.org/rss-autodiscovery
  5. html.spec.whatwg.org/multipage/links.html
  6. developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Conditional_requests
  7. www.w3.org/TR/websub/
  8. developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap
  9. validator.w3.org/feed/
  10. www.rfc-editor.org/rfc/rfc4151.html

Related Posts

Explore on AIDToolStack

Discover tools and servers featured in our directory.

MCP Servers

Trigger.dev Jobs MCP ServerManage Trigger.dev background jobs from your AI coding assistant. Monitor job runs, trigger tasks manually, inspect execution logs, manage schedules, and debug failed runs. The server provides operational visibility into your background job infrastructure — see which tasks are running, queued, or failed, and take action. Your AI can help diagnose job failures from execution logs, retry failed tasks, and optimize concurrency configurations for better throughput.Tailscale Network MCP ServerManage your Tailscale mesh VPN network from your AI coding assistant. View connected devices, manage ACLs, configure exit nodes, check device status, and manage DNS settings. The server provides visibility into your Tailscale network — see which machines are online, troubleshoot connectivity issues, manage network access policies, and configure routes. Useful for developers managing distributed infrastructure where Tailscale provides secure networking between services.Portainer Docker MCP ServerManage Docker environments through Portainer's API from your AI coding assistant. Control containers, images, networks, and volumes across multiple Docker hosts and Kubernetes clusters. The server provides tools for container lifecycle management, image pulling and building, stack deployment, and resource monitoring. Portainer's multi-environment management makes this server particularly valuable for teams managing containers across development, staging, and production environments.

Reviews

Sign in to leave a review.

No reviews yet. Be the first!

Comments

Sign in to leave a comment.

No comments yet. Be the first!

Sponsor Our Newsletter

Reach thousands of developers who are actively evaluating AI tools, MCP servers, and dev infrastructure. Our weekly newsletter goes to engaged technical decision-makers.

Growing subscriber baseHigh open rates

All sponsored content is clearly labeled per our editorial policy.