CheckRSS Check a feed

CheckRSS › Blog › Publishing

How to validate an RSS feed and fix what the validator finds

A practical workflow for validating an RSS or Atom feed: well-formed XML, valid format, real reader behavior, command-line checks and a worked fix.

PublishingCheckRSS5 min read

A feed can pass one validator and still fail in half the readers your subscribers use. That happens because "valid" means three different things, and most people only check one of them. This post walks through all three, in the order that saves the most time, and finishes with a broken feed fixed line by line.

If your feed has already stopped working and you want the list of usual suspects, start with RSS feed not working? instead. This post is about the checking itself: what to run, what each result means, and when to stop.

Three layers of "valid"

The first layer is well-formed XML. The file must parse at all: every tag closed, every & escaped, no stray bytes before the declaration, one root element. A feed that fails here is dead in every reader. There is no partial credit; an XML parser stops at the first error.

The second layer is validity against the format. RSS 2.0 says a channel needs title, link and description. Atom 1.0 says a feed needs id, title and updated, and every entry needs the same three. Dates must follow the format's date syntax. A feed can be perfectly well-formed and still break these rules.

The third layer is whether it works in real readers. Here the specification matters less than habit. Readers deduplicate items by guid, so a feed without one can show the same post twice. They resolve relative links against an address they guess. They give up on slow servers. None of this is strictly a validity error, which is why a clean result from a spec validator does not end the job.

Start with the HTTP response

Before looking at the XML, look at what the server sends. Most "invalid feed" reports turn out to be a login page, a bot challenge or a redirect to the home page.

curl -sI https://example.com/feed/

You want a 200 status (or a single 301 to the real address) and a Content-Type such as application/rss+xml, application/atom+xml, application/xml or text/xml. In our own directory crawl from 15 November 2026, 62 of the 3,329 working feeds were served as text/html and 4 as text/plain. Most readers cope, some refuse, and a few do not even try to parse.

Also try it with a user agent that is not a browser. If the plain request gets a 403 and a browser gets 200, a firewall is blocking feed readers, and no amount of XML editing will fix that:

curl -sI -A "FeedFetcher-Test/1.0" https://example.com/feed/

Check that the XML parses

xmllint ships with libxml2 and is already on most Linux and macOS machines. It prints nothing when the file is well-formed and a line number when it is not:

curl -s https://example.com/feed/ | xmllint --noout -

A typical failure looks like this:

-:14: parser error : EntityRef: expecting ';'
    <title>Fish & Chips</title>
                ^

The line number is the line in the downloaded file, which is the number you need. If the feed is generated by a CMS, that line usually belongs to one post, and fixing the post fixes the feed.

One error xmllint reports in a confusing way is junk before the XML declaration. The declaration must be the very first thing in the file. Look at the first bytes directly:

curl -s https://example.com/feed/ | head -c 64 | od -c | head -3

If the output starts with \n, a space, or the bytes 357 273 277 (a UTF-8 byte order mark), something is printing before the feed. In the directory crawl, 14 feeds had blank space in front of the declaration. On WordPress this is nearly always a blank line after a closing ?> in a theme or plugin file.

Check it against the format

The W3C Feed Validation Service at validator.w3.org/feed is the reference most people know. It checks RSS 2.0 and Atom 1.0 against their specifications and explains each message with a help page. It is still worth running, with two caveats.

It is strict about things that no reader cares about, and it reports them the same way as things that break every reader. A missing atom:link with rel="self" gets a recommendation; so does a feed that will display fine everywhere. It also fetches from its own servers, so a feed behind bot protection can fail there for reasons unrelated to your XML.

It also does not know how readers behave. It will not tell you that two items share a guid, that a feed with 4,000 items takes too long to download, or that every image inside the posts uses a relative address.

Check it the way readers see it

Paste the feed address into the checker. It fetches the feed, parses it, and sorts what it finds into three levels.

Check your feed

Try:

Errors stop some or all readers from using the feed: broken XML, a missing required element, an address that returns a web page. Fix these first.

Warnings do not stop the feed from loading, but they cause visible problems in some readers: duplicate or missing guid values, dates in the wrong format, relative links inside items, no self link. Fix these next.

Info notes are observations, such as a feed that has not published in months. Act on them if they surprise you.

The page every check explained lists each test with the usual fix. For scale: of the feeds in our directory crawl, 2,027 came back valid, 1,089 had warnings and 165 had errors. The single most common warning, in 525 feeds, was the missing self link.

A worked example

Here is a small feed with three problems, the kind a CMS produces after someone pastes from a word processor:

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
  <title>Corner Bakery News</title>
  <link>https://bakery.example/</link>
  <description>What we baked this week</description>
  <item>
    <title>Bread & butter pudding is back</title>
    <link>https://bakery.example/news/pudding</link>
    <description>Every Friday&nbsp;from 8 am.</description>
    <pubDate>Fri, 13 Nov 2026 07:00:00 +0000</pubDate>
  </item>
</channel>
</rss>

Run it through xmllint and you get the first error on line 8: the bare & in the title. XML treats & as the start of an entity, so it must be written &amp;. Fix that and run it again. Now line 10 fails with Entity 'nbsp' not defined. HTML knows &nbsp;, XML does not. Use the numeric form &#160;, or a plain space, which is what the author meant anyway.

With both fixed, the file parses, and the W3C validator accepts it with a recommendation to add a self link. The checker goes one step further and warns that the item has no guid. Without one, readers fall back to the link or the title to decide whether an item is new. Edit the title and some readers will show the post again as a fresh item.

The fixed feed:

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Corner Bakery News</title>
  <link>https://bakery.example/</link>
  <description>What we baked this week</description>
  <atom:link href="https://bakery.example/feed.xml" rel="self" type="application/rss+xml"/>
  <item>
    <title>Bread &amp; butter pudding is back</title>
    <link>https://bakery.example/news/pudding</link>
    <guid isPermaLink="true">https://bakery.example/news/pudding</guid>
    <description>Every Friday from 8 am.</description>
    <pubDate>Fri, 13 Nov 2026 07:00:00 +0000</pubDate>
  </item>
</channel>
</rss>

The guid here is the permanent post address, which is the simplest choice as long as addresses never change. If they might (a slug edit, a move to a new domain), use an identifier that does not depend on the address, such as tag:bakery.example,2026:post-412 with isPermaLink="false".

When to stop

A feed is done when it parses, has no errors in the checker, and the remaining warnings are ones you understand and chose to keep. Chasing every W3C recommendation is rarely worth it. Checking again after every CMS or plugin update is, because that is when feeds break without anyone noticing. If you want to automate that, the status badge and API can run the same check from a script or a CI job, and the encoding and date problems that slip past a quick look are covered in detail in common RSS errors.

More from the blog