Syndicator Blog

OPML

OPML Files Explained for Moving Feed Subscriptions Between Readers

If you have ever switched feed readers without retyping 200 URLs, you used OPML. It's the export file every reader offers and almost nobody opens. It's worth opening once, because it's tiny and plain, and knowing what's inside makes migrations less scary.

What OPML is

OPML stands for Outline Processor Markup Language. Dave Winer created it around 2000 for outliners, which is why the core element is called outline. Version 2.0, drafted in 2006, added a section on subscription lists. That section is the reason feed readers use it today.

A subscription list looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<opml version="2.0">
  <head>
    <title>My subscriptions</title>
  </head>
  <body>
    <outline text="Pixel Effects" type="rss"
      xmlUrl="https://pxef.com/feed/"
      htmlUrl="https://pxef.com/" />
  </body>
</opml>

That's nearly the whole format. Each feed is one outline with three attributes that matter: type="rss", xmlUrl for the feed itself and htmlUrl for the website. text is the label a reader shows. type="rss" is used for Atom feeds too, which is a historical quirk nobody has fixed.

Folders are just outlines nested inside outlines:

<outline text="Photography">
  <outline text="Pixel Effects" type="rss" xmlUrl="https://pxef.com/feed/" />
  <outline text="Media Gallery" type="rss" xmlUrl="https://mediagallery.org/feed/" />
</outline>

Moving between readers

The routine is the same everywhere. Export OPML from the old reader, usually in settings under import and export. Import it into the new one. Your feeds and folders come across.

What doesn't come across is read state, starred items, saved articles, tags and filters. OPML only describes subscriptions. If those other things matter, check whether both readers support the Google Reader API or Fever API sync, or export starred items separately.

Some things that trip people up:

  • Folders more than one level deep get flattened by some readers. Most readers only show one level anyway.
  • Feeds that redirected years ago may still sit in your file under the old URL. The new reader follows the redirect or flags it as dead. Either way, it's a good moment to prune.
  • Big files are fine. A few thousand outlines is still a small XML file.

OPML as a publishing tool

The less known use is publishing an OPML file so other people can subscribe to a whole set of feeds in one go. A blogroll, a topic bundle, a list of every site in a network.

Syndicator does this. Every build writes feeds.opml, with one outline for each of the 114 sites it aggregates. Import it into any reader and you get the full set as individual subscriptions instead of the merged stream.

Its home page also advertises the file with a link tag in the head, the same autodiscovery pattern used for feeds:

<link rel="alternate" type="text/x-opml" href="/feeds.opml">

text/x-opml is the MIME type you'll see most. Some servers send application/xml or text/xml, and readers accept those too.

A small caution

OPML 2.0 dates use RFC 822, the same old date format as RSS. Most tools ignore OPML dates entirely, so this rarely bites. Validation tools exist but readers are forgiving. In practice, if the file is well-formed XML and every feed has an xmlUrl, it will import.

That's the whole format. Keep an export of your subscriptions somewhere safe. Readers come and go, and an OPML file is the one thing that lets you leave.