• Stack Overflow Public questions & answers
  • Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
  • Talent Build your employer brand
  • Advertising Reach developers & technologists worldwide
  • About the company

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

What is the correct MIME type to use for an RSS feed?

Is one MIME type preferable to ensure compatibility with RSS readers and other scrapers?

The options seem to be:

Interestingly Stackoverflow is using text/html.

Steve Claridge's user avatar

7 Answers 7

Neither. It's application/rss+xml http://www.rssboard.org/rss-mime-type-application.txt

vartec's user avatar

Other commenters have pointed out that the single correct mime type is application/rss+xml, .

However, if you are setting an accept header for a client then

Accept: application/rss+xml, application/rdf+xml;q=0.8, application/atom+xml;q=0.6, application/xml;q=0.4, text/xml;q=0.4

might be a good choice, as it states that it accepts RSS, Atom, and XML (in descending order or preference).

Ruben Verborgh's user avatar

Here's a pragmatic answer: whatever the "correct" answer may be (and clearly there is debate about this), text/xml is the type used by pretty much all the popular feeds out there in the wild.

Here are a few that I checked:

So you can be sure that text/xml will be correctly interpreted by commonly used RSS clients.

Kai Carver's user avatar

The most correct is application/rss+xml

The most compatible is application/xml

According to W3C:

RSS feeds should be served as application/rss+xml (RSS 1.0 is an RDF format, so it may be served as application/rdf+xml instead). Atom feeds should use application/atom+xml. Alternatively, for compatibility with widely-deployed web browsers, any of these feeds can use one of the more general XML types - preferably application/xml.

https://validator.w3.org/feed/docs/warning/UnexpectedContentType.html

nggit's user avatar

Go for MIME application/rss+xml to be safe if you want to make sure your feed is compatible with RSS readers and other scrapers. That's what I use.

adyoungsfan's user avatar

You could use text/xml , but the correct MIME type would be application/rss+xml .

Cerebrus's user avatar

text/xml is the only correct answer. Mime types are a registration based system. There is an official list managed by IANA (Internet Assigned Numbers Authority) at http://www.iana.org/assignments/media-types/media-types.xhtml

Monkey Code's user avatar

Your Answer

Sign up or log in, post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service , privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged rss mime-types or ask your own question .

Hot Network Questions

type= application/rssxml /

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy .

Feed Validation Service

Check the syntax of Atom or RSS feeds

Feeds should not be served with the ' type/subtype ' media type

Explanation

The web server is reporting an unexpected MIME type for a feed. Although we tried to parse it as a feed, aggregators may well report this as an error and act as if the user had pointed them at something other than a feed.

RSS feeds should be served as application/rss+xml (RSS 1.0 is an RDF format, so it may be served as application/rdf+xml instead). Atom feeds should use application/atom+xml . Alternatively, for compatibility with widely-deployed web browsers, any of these feeds can use one of the more general XML types - preferably application/xml .

Use the appropriate MIME type for your feed.

Not clear? Disagree?

You might be able to find help in one of these fine resources .

Pete Freitag

The Proper Content Type for XML Feeds

RSS Feeds have a content type problem. Most people end up serving them with the content-type: text/xml . But this practice is frowned upon for several reasons. The main reason people don't like text/xml is because its very vague, there are content types such as application/rss+xml , application/rdf+xml , and application/atom+xml that describe the content of your feed much better than text/xml does. We should be using these types for our feeds.

The problem, however with the more descriptive content types is that Firefox and IE prompt you to download the XML file instead of displaying it in the browser like it would a text/xml document.

So what I have decided to do, is to serve the feeds as text/xml if the user agent contains Mozilla . So for IE, Firefox, and Safari 1.x my feed will be served in text/xml other clients will get the proper application/rss+xml MIME type. Here's my code for this:

I realize that this is not a perfect solution, it may cause browser plugins to have to do some extra work to determine if the document is an RSS, RDF or Atom Feed. Additionally if aggregators are including Mozilla in their user agent, they will get text/xml . But I'm not going to risk loosing potential subscribers over this issue, as some bloggers have reported to be the case when switching.

So I will serve a variable content-type at least until bug 256379 is fixed in a production release of FireFox (or if IE beats them I guess :). You can vote for that bug in bugzilla if you find the save dialog to be annoying when you click on RSS feeds.

I also hope that IE7 is will serve the rss related content-types as it would a text/xml doc by default. Scoble, can you make sure IE7 deals with this? (apparently Robert Scoble will read your post if you put his name in it...)

Tim Bray has pointed out why its important for people to get their act together:

To manage the traffic load we're going to have to do some caching. Fortunately, RSS contains some publication and expiry-date data to help intermediate software do this, but to do this it has to recognize the data as RSS and read this stuff. This isn't going to happen until RSS gets served with the proper Media-type. When someone writes RSS-reader code to live in the Web Browser, it's going to need a consistent Media-type to be able to recognize RSS.

Yet Another Community System cites some of the problems with text/xml such as the character set issues:

The default character set, which must be assumed in the absence of a charset parameter, is US-ASCII or ISO-8859-1 for all MIME types prefixed by text, depending of the Request for Comment you are considering. Of course, having two different specifications is confusing to the software industry. But also, no one of these two charsets can support complex foreign charsets as those used in Asia. On the other hand, implementors and users of XML parsers tend to assume that the default charset is provided by the XML encoding declaration or BOM.

Like this? Follow me ↯

The Proper Content Type for XML Feeds was first published on June 13, 2005.

If you like reading about rss, xml, atom, rdf, content-type, http, mime, firefox, ie, or mozilla then you might also like:

XML Tutorial

Xpath tutorial, xslt tutorial, xquery tutorial, xsd data types, web services.

With RSS it is possible to distribute up-to-date web content from one web site to thousands of other web sites around the world.

RSS allows fast browsing for news and updates.

RSS Document Example

What is rss.

Why use RSS?

RSS was designed to show selected data.

Without RSS, users will have to check your site daily for new updates. This may be too time-consuming for many users. With an RSS feed (RSS is often called a News feed or RSS feed) they can check your site faster using an RSS aggregator (a site or program that gathers and sorts out RSS feeds).

Since RSS data is small and fast-loading, it can easily be used with services like cell phones or PDA's.

Web-rings with similar information can easily share data on their web sites to make them better and more useful.

Advertisement

Who Should use RSS?

Webmasters who seldom update their web sites do not need RSS!

RSS is useful for web sites that are updated frequently, like:

Benefits of RSS

Here are some benefits of using RSS:

Choose your news With RSS you can choose to view the news you want, the news that interest you and are relevant to your work.

Remove unwanted information With RSS you can (finally) separate wanted information from unwanted information (spam)!

Increase your site traffic With RSS you can create your own news channel, and publish it to the Internet!

The History of RSS

RSS 1.0 is the only version that was developed using the W3C RDF (Resource Description Framework) standard.

The idea behind RDF was to help create a Semantic Web. However, this does not matter too much for ordinary users, but by using web standards it will be easier for persons and applications to exchange data.

What RSS Version Should I Use?

RSS 0.91 and RSS 2.0 are easier to understand than RSS 1.0. Our tutorial is based on RSS 2.0.

The syntax rules of RSS 2.0 are very simple and very strict.

Is RSS a Web Standard?

There is no official standard for RSS.

How RSS Works

RSS is used to share content between websites.

With RSS, you register your content with companies called aggregators.

So, to be a part of it: First, create an RSS document and save it with an .xml extension. Then, upload the file to your website. Next, register with an RSS aggregator. Each day the aggregator searches the registered websites for RSS documents, verifies the link, and displays information about the feed so clients can link to documents that interests them.

Tip: Read our RSS Publishing chapter to view free RSS aggregation services.

RSS Example

RSS documents use a self-describing and simple syntax.

Here is a simple RSS document:

The first line in the document - the XML declaration - defines the XML version and the character encoding used in the document. In this case the document conforms to the 1.0 specification of XML and uses the UTF-8 character set.

The next line is the RSS declaration which identifies that this is an RSS document (in this case, RSS version 2.0).

The next line contains the <channel> element. This element is used to describe the RSS feed.

The <channel> element has three required child elements:

Each <channel> element can have one or more <item> elements.

Each <item> element defines an article or "story" in the RSS feed.

The <item> element has three required child elements:

Finally, the two last lines close the <channel> and <rss> elements.

Comments in RSS

The syntax for writing comments in RSS is similar to that of HTML:

RSS is Written in XML

Because RSS is XML, keep in mind that:

The RSS <channel> Element

The RSS <channel> element describes the RSS feed.

Look at the following RSS document:

As mentioned before, the <channel> element describes the RSS feed, and has three required child elements:

The <channel> element usually contains one or more <item> elements. Each <item> element defines an article or "story" in the RSS feed.

Furthermore, there are several optional child elements of <channel>. We will explain the most important ones below.

The <category> Element

The <category> child element is used to specify a category for your feed.

The <category> element makes it possible for RSS aggregators to group sites based on category.

The category for the RSS document above could be:

The <copyright> Element

The <copyright> child element notifies about copyrighted material.

The copyright for the RSS document above could be:

The <image> Element

The <image> child element allows an image to be displayed when aggregators present a feed.

The <image> element has three required child elements:

The image for the RSS document above could be:

The <language> Element

The <language> child element is used to specify the language used to write your document.

The <language> element makes it possible for RSS aggregators to group sites based on language.

The language for the RSS document above could be:

The <item> Element

Each <item> element defines an article or "story" in an RSS feed.

As mentioned before, each <item> element defines an article or "story" in the RSS feed.

Furthermore, there are several optional child elements of <item>. We will explain the most important ones below.

The <author> Element

The <author> child element is used to specify the e-mail address of the author of an item.

Note: To prevent spam e-mails, some developers do not include the <author> element.

The author of the item in the RSS document above could be:

The <comments> Element

The <comments> child element allows an item to link to comments about that item.

A comment of the item in the RSS document above could be:

The <enclosure> Element

The <enclosure> child element allows a media-file to be included with an item.

The <enclosure> element has three required attributes:

A media-file included in the item in the RSS document above could be:

Get Your RSS Feed Up On The Web

Having an RSS document is not useful if other people cannot reach it.

Now it's time to get your RSS file up on the web. Here are the steps:

1. Name your RSS file. Notice that the file must have an .xml extension.

2. Validate your RSS file

3. Upload the RSS file to your web directory on your web server.

5. Put the little orange "RSS" or "XML" button on the page where you will offer RSS to the world (e.g. on your home page). Then add a link to the button that links to the RSS file. The code will look something like this: <a href="https://www.w3schools.com/xml/myfirstrss.xml"> <img src="https://www.w3schools.com/xml/pic_rss.gif" width="36" height="14"> </a>.

6. Submit your RSS feed to the RSS Feed Directories (you can Google or Yahoo for "RSS Feed Directories"). Note! The URL to your feed is not your home page, it is the URL to your feed, like "https://www.w3schools.com/xml/myfirstrss.xml".

7. Register your feed with the major search engines:

8. Update your feed - After registering your RSS feed, you must make sure that you update your content frequently and that your RSS feed is constantly available.

Can I Manage my RSS Feed Myself?

The best way to ensure your RSS feed works the way you want, is to manage it yourself.

However, this can be very time consuming, especially for pages with lot of updates.

An alternative is to use a third-party automated RSS.

Automated RSS

For users who only need an RSS feed for their personal website, some of the most popular blog (Web Log) managers that offer built-in RSS services are:

RSS Readers

An RSS Reader is used to read RSS Feeds!

RSS readers are available for many different devices and OS.

There are a lot of different RSS readers. Some work as web services, and some are limited to windows (or Mac, PDA or UNIX):

I have an RSS Reader. Now what?

Rss reference, the <channel> element.

The links in the "Element" column point to more information about each specific element.

Get started with your own server with Dynamic Spaces

COLOR PICKER

colorpicker

Get your certification today!

type= application/rssxml /

Get certified by completing a course today!

Subscribe

Report Error

If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:

[email protected]

Your Suggestion:

Thank you for helping us.

Your message has been sent to W3Schools.

Top Tutorials

Top references, top examples, web certificates, get certified.

Tools, FAQ, Tutorials:

JSON Validator/Formatter

JSON to XML Converter

XML to JSON Converter

JSON FAQ & Tutorials

Python FAQ & Tutorials

PHP FAQ & Tutorials

OpenID FAQ & Tutorials

EPUB FAQ & Tutorials

XHTML Tutorials

CSS Tutorials

RSS FAQ & Tutorials

Visual Studio Tutorials

Azure API Tutorials

Developer Jobs

Interview Questions

Other Resources:

Software QA Resources

Developer Resources

DBA Resources

Windows Tutorials

Java JAR Files

File Extensions

Security Certificates

Regular Expression

Link Directories

Interview Q & A

Biotech Resources

Cell Phone Resources

Travel Resources

Frequently Asked Questions

Blockchain Container EPUB General HTML JSON Microsoft Node.js PHP Python RSS Tools Visual Studio Web

Home Hot About Collections FAQ Interview RSS Atom Site Map Tools Ask

Tester Developer DBA Windows JAR DLL Files Certificates RegEx Links Q&A Biotech DOI Phones Travel FAQ

MIME Type Definition for RSS Files

What Is the MIME Type Definition for RSS Files?

✍: FYIcenter.com

⇒ Introduction of RSS

⇒⇒ RSS FAQ and Tutorials

2017-12-21, 1379👍, 0💬

Related Topics:

Copyright © 2023 FYIcenter.com

All rights in the contents of this web site are reserved by the individual author. fyicenter.com does not guarantee the truthfulness, accuracy, or reliability of any contents.

Popular Posts:

JSON to XML Conversi...

How to use the JSON to XML Conversion Tool at freeformatter.com? If you want to try the JSON to XML ...

API Management Servi...

Where is API Management Service on my Azure Portal? If your IT department has signed up for an Azure...

"link" - Link Object...

How to use "link" command tool to link objet files? If you have object files previously compiled by ...

'cellpadding' - Padd...

How To Control Padding Spaces within a Table Cell? Cell padding spaces are spaces between cell inner...

Add Request Query St...

How to add request query string Parameters to my Azure API operation to make it more user friendly? ...

Developer Resources

Feed_content_type( string   $type  =  ''  ).

Returns the content type for specified feed type.

Default: ''

File: wp-includes/feed.php . View all references

View on Trac View on GitHub

Filters the content type for a specific feed type.

User Contributed Notes

You must log in before being able to contribute a note or feedback.

Insert/edit link

Enter the destination URL

Or link to existing content

How to add a RSS feed to a Remix app

Summary ❧ Remix allows you to generate responses for any kind of page, not just rendering React components, which can be used to easily create a RSS feed for a blog.

One of the advantages of using Remix is that you have access to the server side code and can easily generate responses for any kind of page, not just rendering React components. For example, you can create a RSS feed for your blog fairly easily.

Since I first created my website, Remix added a new feature, called resource routes , which are essentially pages that do not render any components and instead just return some data (JSON, XML, etc), which is perfect for making a RSS feed.

I set up my RSS feed under the root path: camchenry.com/rss.xml . I created a file called [rss.xml].tsx in the app/routes directory. The file name contains brackets [] , because Remix normally converts a period ( . ) to a slash in the URL by convention. But we want to change the URL to contain .xml , so we need to escape it by using the brackets.

Every RSS file has a number of required and optional fields , but in this case we're only using the bare minimum of required fields to get it working.

A RSS file is essentially just a list of items, so we create a type definition for each entry:

Then, we will define a function to generate the XML for the RSS feed based on our list of RSS entries:

A few notes:

Finally, to create a resource route, we need to export a loader from our file without exporting any other functions. Instead of rendering HTML like normal, the server will render this response instead:

A brief explanation of some of the code above:

Now when we visit /rss.xml we should see a XML RSS feed!

Working With Web Feeds: It’s More Than RSS

Between Google Chrome experimenting with “following” sites , along with a growing frustration of how social media platforms limit a creator’s reach to their fans through algorithmic feeds, there’s been renewed interest in RSS feeds and they’re primed for a comeback as we get into 2022.

I miss the days of RSS, where each website could plant its own little flag on the internet, rather than a massive, blunt algorithm deciding what people are allowed to see. I've still got an RSS feed, but I don't think anyone who isn't tech-savvy really uses it. — The Oatmeal (@Oatmeal) July 7, 2021

This research is brought to you by support from Frontend Masters , CSS-Tricks’ official learning partner.

Need front-end development training?

Frontend Masters  is the best place to get it. They have courses on all the most important front-end technologies. Interested in going full-stack? Here’s your best bet:

You may have heard whispers that “RSS in dead” around the web, but the truth is that they are still widely used as virtually every podcast uses one. Maybe you used to be an RSS fan and need to get re-acquainted with it. Or maybe you’re like Chris here at CSS-Tricks and still love RSS . Whatever the case, RSS is a web technology like any other, and there are best practices for how to create and curate a feed.

That’s exactly what I’m going to walk you through in this article. Let’s talk about the different kinds of feeds, how to implement them, and what strategies you can use to get the most out of your feed content.

RSS vs. Atom vs. JSON

Believe it or not, RSS is just one format among other types of syndicated web feeds . The most common formats are:

I’ve used RSS to signify these formats since it’s a far more popular search term but I’ll refer to these technologies as web feeds in this article unless I’m referring to a specific format.

On Sept 26–Oct 2, 2021, RSS had 37 points, web 6, atom 2 and jsonfeed 0. S

While Atom, RSS and, JSON feeds accomplish the same thing, there are a few differences between them:

Other than these things, there are only minor differences between them. You might think that the size of the file could be a possible difference, but compression reduces them all to just a few kilobytes apiece. Unless your application has a specific use case that requires a specific format (like podcasts), it doesn’t hurt to provide multiple formats, but RSS and Atom have the most support.

What makes a “good” feed?

Let’s look at some best practices for making feeds. Like most things on the web, there are things we can do to optimize our work to get the most out of it.

1. It’s easy to find

It doesn’t help to have a feed if no one knows about it. And one way to make a feed discoverable is to link it up in the <head> of your site. This way, feed readers are able to crawl and recognize when a site offers a content feed.

Here’s an example showing all three formats linked up in the document head:

And, yes, it’s OK to use all three! You can specify as many links as you want, though some feed readers might only recognize the first one. The important thing is that one includes rel="alternate" and the feed’s MIME type . There’s also the option to add a title which never hurts.

What else can you do to make your feed easy to find? Advertise it! Place direct links to the feeds somewhere prominent on your site that people can use to copy and paste into their feed reader.

That’s what CSS Tricks does. This is the link to the site’s RSS and it’s available in the footer across the entire site. Some feed readers can pick up on these links, too, even though they are outside of the <head> .

Screenshot of the CSS-Tricks footer showing a column of links with the heading Follow, and links for social networks, including the site's RSS feed. The background is near black, the headings are orange, and the links are light gray.

As for what to name the feed itself, it doesn’t matter as long as it’s discoverable. Here’s a good look into how various sites name their feeds , but I’ve named mine feed.json , feed.rss.xml and feed.atom.xml for JSON feed, Atom, and RSS respectively.

2. It takes advantage of HTTP

There are certain basic features of the web that can be leveraged to make your feeds a little better.

For example, be sure to compress your feeds, as it greatly reduces the overall file size and the time to download it. Most servers can take care of this for you, using gzip, Brotli, or some other compression engine.

Likewise, it’s a good idea to support either ETags or If-Modified-Since as they both allow clients to cache feeds and informs the browser whether a newer version of the feed is ready before it is downloaded. Much like compression, your server may take care of this as well.

Another thing to do: enable permissive CORS. Otherwise, clients could be blocked from fetching the feed. And while you should consider the security implications of letting any old site fetch your feed, it’s highly unlikely that it becomes a major issue for most small sites and feeds. This one-liner is all you need to enable CORS:

3. It displays full content instead of summaries

This is totally a user experience thing. You may have even experienced this before, where you subscribe to an RSS feed and all you get is the first paragraph or a summary of the post. Why? The traditional thinking is that providing only a summary encourages users to click through to your site, thereby leading to more visits. And more visits equals more eyeballs, which equals more revenue, etc.

I suggest avoiding that and instead allow your feeds to send the entire content for each post/entry/item. Many users prefer reading content in a feed reader because of the emphasis they place on legibility.

If you’re concerned about some dishonest person scraping your content and displaying it on their own site because you’re feeding the full content, let me reassure you: it’s no harder to a web page than a syndicated feed.

And if you’re a publisher who relies on display ads, and are concerned about the impact that sending full content might have on your revenue: you can still add static ads directly into your feed content. Besides, some readers can parse the web page associated with a feed entry so it can be read in the reader as well.

Dark UI with blue links and light gray text showing an article from a blog.

But let’s not be dogmatic and all, because there are situations where summaries make sense. One is when a feed has a bunch of long-form entries. Another is when you have rich content that can only be viewed in a particular way (think show notes for a podcast). In that case, try making a good summary. One example is Nielsen Norman Group’s RSS which has a summary and an excerpt up to the first <h2> tag.

If I ever decide to only show summaries in my feed, I’d make sure to include an image, an outline of the content’s main points, and a link to the canonical version in addition to the summary. It is a bit of work but it gives the reader an idea what to expect, unlike some feeds I’ve seen which awkwardly truncate content to just the first few words.

Showing a post title in white with the published date and time below it in light gray. Below that is an image of a tired looking man with dark slicked back hair holding a 10 of diamonds card. Below that is the first sentence of a post that breaks mid-sentence.

4. It is designed for reading

When crafting content, consider how it might be seen outside the context of a web browser, in places where JavaScript and CSS are limited. Sara Soueidan has a bunch of tips and ideas that are worth checking out. The main idea: provide a good fallback experience for your content.

This is a mostly an issue when it comes to embedded elements. While some embeds contain fallback content in their markup (like Twitter’s embedded tweets and CodePen’s embedded pens), others might not. Certain embeds (including videos posted to Vimeo) can only be embedded on certain domains meaning those won’t show up in a feed reader. So you need provide a way to view it somehow, like an image or a link to a webpage.

type= application/rssxml /

There are plenty of ways to do fallbacks. Twitter’s embed falls back to a <blockquote> — which makes total sense as a tweet is sort of like a quote — and a link to the tweet itself, which allows some clients that do not support embeds, like Outlook, to effectively render the content in a way that is still accessible to the user.

Though NetNewsWire is good with embeds, YouTube sometimes prevents it from playing videos like here. So, instead, the embed falls back to a link that points the user to watch it on YouTube’s site. Outlook doesn’t support YouTube embeds (or any embeds at all), but a descriptive link to the video on YouTube is still available.

The moral of the story: know your readers and how they render content so you can provide the best fallback experience possible.

Beware of relative URLs

One big issue across feeds is resolving relative URLs for images and links. Resolving based off the feed’s canonical link might work, but what happens if that link is in a subdirectory? The XML formats could use the xml:base attribute which defines the base URL to use when resolving relative URLs, but that’s only supported by Atom and is ignored and deprecated by most readers.

The most robust solution is to use absolute URLs for every href and src in an entry’s content. Meaning that the markup looks something like this:

…and neither this:

This is hard to do automatically, moreso with statically-generated sites. One approach is to make relative URLs absolute after compiling the feed in a build pipeline. Another approach is to manipulate the way Markdown links and images are rendered by your static site generator so that the URLs are absolute. I hope that more static site generators allow the second option but, for now, Hugo is the only static site generator that supports this through Markdown render hooks .

But wait, there’s an exception to this rule. And it’s footnotes. Some readers can detect footnotes and handle them. Here’s some HTML that should work in any feed reader that supports relative jump links:

How to handle ads in feeds

You’re unlikely to get JavaScript support inside of an RSS reader, and that means no ads connected to an ad server. In other words, ads will need to be part of your content rather than something that is dynamically injected into place.

Showing an advertisement for anima that displays a brightly colored image, text below the image that says our sponsor, followed by the post title in blue, a blurb from the article content, them a blue learn more link.

PSA: Not all content needs to be included in a feed

I’ve seen feeds in which every piece of content published is packed in and made available all the way back to the very first entry in the feed. I also see plenty of feeds from publishers who post dozens of entries a day. In both cases, I suggest limiting both the amount of content that’s available from past archives and considering multiple feeds instead of one.

Perfect example. Check out MacRumors.com’s feed because it’s extremely active with dozens of new articles published daily. Can you imagine going back to an article from, say, 10 years ago in that feed? Likely not. Unless the feed is for a podcast where storing every episode makes sense, try limiting the number of entries stored in your feed, as users are likely more interested in newer content. This reduces bandwidth and reduces update times which especially counts since users have many feeds to refresh.

I am tempted to say that 10–15 posts is enough to store and display at a time, but like many things, “it depends.” While storing a few makes sense for a site that pushes new content a few times a month, other sites that post way more frequently might eclipse that in a day. So, really, the ideal number of posts is going to depend on the type of content you publish (is it timely or evergreen?) and both the volume and frequency of what you publish (is it a lot throughout the day or a few times a month?).

But what I’m really trying to get at is that you want to avoid overwhelming users by inundating them with a pile of articles to get through. A couple of ways to avoid that include:

The reason I’m so fussy about the size of a feed is that—like images, scripts, and other assets—the number and size of feeds affect the performance of a feed reader. The more feeds a user is subscribed to and the more entries that need to be fetched from those feeds add to the time it takes to refresh and display that content.

Moving feeds

Like websites might change domains, you may need to move a feed from its current address. It’s not terribly difficult to do, but there are important things to consider before making a move.

For instance, it’s a good idea to ensure that your feed’s items have a global unique identifier (GUID). This maps out to feed’s guid in RSS and its id in both Atom and JSON. The GUI prevents feed readers from fetching duplicate entries. This is all the more important (and challenging) if you’re working with a static site.

While it may be tempting to use the entry’s permalink as an identifier, remember, those can change. To make a GUID, I’d recommend looking into using a tag URI . A tag URI consists of:

The <specific> portion could be something like the relative portion of your site’s homepage URL (i.e. / ) and the fragment can be the content’s published timestamp. For instance, a post here on CSS Tricks could have a tag URI that looks like this:

This way, the authority date ensures that even if the domain changed hands. Plus, it can be managed in a static site generator as you can track domain changes over time.

The biggest reason I suggest the tag URI scheme is that Atom requires a feed’s id to be in a URL format. Even though RSS and JSON don’t have the same constraint, the tag URI scheme works for them as well, meaning we have full support.

And, with a robust id in place, a feed can be safely moved without feed readers pulling in duplicate entries. To move the feed itself, set up a 301 redirect to the new location and you’re done.

You might come across a technique called the XML redirect in which a file containing the feed’s new location is placed at the old location. As great as this would work for times when you can’t manipulate HTTP codes, I couldn’t find any feed readers which implement this.

Validating a feed

Feeds, like HTML, need to be valid in order to properly work. The benefit of a validated feed is that you know your code is free from errors and that entries are properly flowing from your site to feed readers.

W3C’s feed validation service is one option for RSS and Atom feeds. You provide the URL to the feed or paste the feed’s actual code, and you’ll get a full report that shows whether you’re hitting all the best practices. You’re likely to get warnings. It happens. Most warnings are really just a heads up and might not have an impact on the feed.

That said, there are two things that should always be addressed when validating a feed:

What about JSON? To validate a JSON feed, try either using validator.jsonfeed.org or verifying against the JSON Feed schema using any JSON schema validator .

Managing or restricting access to a feed

You know how you can subscribe to a paid podcast and you get access to a special feed URL that contains all the “premium” content you gain access to with your subscription? Well, that’s because we can control who has access to a particular feed while locking others out from receiving the content.

There are two techniques for managing access to a feed:

As long as the URL is HTTPS, they have the same security, as the URL paths and passwords are encrypted. As for handling authentication it on the server, that’s a whole other topic though there are quite a few articles on it rig h t here on CSS-Tricks .

Join the RSS Club!

OK, so the first rule of the RSS Club is:

Don’t talk about it. Let people find it. Make it worthwhile.

But I’m going to talk about it because feeds that are part of the RSS Club are excellent examples of tailored feeds. That’s because the feed entries are only available in those feeds. In other words, the blog posts are published, but never display on the actual site — they’re only accessible by feed.

Dave Rupert founded the club a number of years ago and it’s a great way to make RSS a first-class citizen for consuming content within a small community.

Joining the club means having a dedicated feed for posts that are only available in that feed. For example, in WordPress, you could create a new “RSS Club” category and filter it out of the main post query . That way, you’re able to either provide a feed just for that category, or the full feed that still includes posts in that category.

(Sorry for spilling the beans, Dave!)

Web feeds beyond content

RSS can be used for more things than blog posts or articles. For instance, GitHub has Atom feeds for issues, commits, pull requests, and releases.

They can also be used to provide updates. Let’s say you wanted a feed that notifies you when there are changes to your website. That’s a great idea, right? Always nice to know what’s happening, especially when there’s more than one cook in the kitchen.

You could build some sort of system that polls your feed periodically for changes then trigger a new feed entry, but that requires a lot of resources. Another idea is to implement webhooks you tell where to look for changes. Then again, managing and sending out notifications can be a hassle, especially if all you want is to monitor content.

I think it’s worth checking out WebSub . You, as a publisher, tell a hub that the site has changed, and the hub notifies whatever system that’s subscribed to the site’s web feeds. You can publish your feed to an existing hub — like Google’s PubSubHubbub Hub — then specify the hub in your feeds. YouTube has implemented this.

What’s a tutorial like this without a few good examples? Let’s look at three real-world examples.

1. RSS Podcast

Did you know that CSS-Tricks has a podcast for an ongoing series that covers web history? Well, it does. And, yes, you can subscribe to it via RSS.

Podcasts must use RSS with the xmlns:content and xmlns:itunes extensions, which are needed to provide metadata about the podcast and its episodes. The audio file for each episode is specified in an enclosure along with its mime type and size. RSS is limited to one enclosure, but both Atom and JSON support multiple enclosures.

Here’s the feed. Notice the iTunes-specific tags as well as other bits of information that are provided for additional context:

2. RSS for posts

Let’s look to CSS-Tricks once again, this time for an example of what a pretty standard RSS feed of blog posts looks like.

The code for this particular RSS feed is a little more verbose than your typical feed, and that’s to do with the multiple extensions added to the <rss> tag. A number of them aren’t reachable but there are some that handle other things, like xmlns:wfw for comments, xmlns:dc for additional metadata, and xmlns:sy for information on how often the feed is refreshed.

3. JSON feed

This is actually my personal feed and I just so happen to use JSON for it. It’s pretty bare bones and less cluttered than the other examples because, as far as I know, there are no JSON extensions like the RSS ones we saw in Example 2.

I find that JSON is much easier to read and understand all that’s needed is an object with the feed data rather than writing out the entire template.

Web Feed Implementations Across CMSs and Static Site Generators

Many CMSs and static site generators support web feeds, though it’s usually RSS as it has the widest support. Here are some CMSs that support web feeds:

And here’s some resources on adding web feeds (again mostly RSS) to various static site generators

Wrapping up

And there you have it! This is what I believe be nearly everything you need to consider when implementing a web feed. We looked at three different formats (RSS, Atom, JSON), covered best practices for creating a user-friendly feed reading experience, walked through validating a feed, covered the possibility of authenticating feeds, looked at three real-world examples of feeds in the wild, and provided some implementations across various technologies.

(Oh, and there was that thing where the first rule of the thing is not to talk about the thing.)

I hope these guidelines empower you to make resilient web feeds. If you have any questions on implementing a web feed, or you just feel like sharing your RSS feed, please do leave a comment!

I’ve been using Feedly for RSS ever since Google Reader shut down. I keep two tabs open in the browser, always: Gmail and Feedly. From web tech to motorcycles to RV-related stuff to webcomics, I completely rely on RSS!

Been reading CSS-Tricks for years that way.

Yes I still love RSS and hope it doesn’t go away. In terms of keeping up with a bunch of different sites, in a clean, comprehensive (and especially, time-efficient) way, it can’t be beaten. It works how the user wants IMO.

It’s how I keep up with CSS-Tricks BTW

I keep up with a bunch of programming blogs this way. Here’s my my opml export if you want to follow some new feeds.

Very comprehensive. You must’ve done a ton of research. Great job.

Here’s a suggestion for your summary of Web feed support among CMSs and SSGs. Zola can generate RSS and Atom feeds out-of-the-box.

Also, I’d love to know which feed readers you have pictured. I can’t find one I like.

Oh I’d forgotten about Zola.

The feed reader I used for most of the screen shots is NetNewsWire on iOS.

I’ve been using RSS for ages. I currently use inoreader, in terms of features and price it’s way ahead of feedly. I came here from a RSS post :)

Thanks for this writeup!

I’ve implemented an RSS feed for my newsletter, and we’re at like 160 issues now. This is kind of a dumb question, but is the RSS feed the entire library / table of contents of ALL the issues? Is it usually the latest 10? I’ve added all of the issues on there and it’s really long.

Is that what you’re supposed to do, or am I doing it completely wrong?

I wouldn’t put every issue in a feed since it’ll get redundant. I’d recommend making separate feeds, one with the most recent posts and another with all of them.

Yes, very good article!

One is when a feed has a bunch of long-form entries.

I don’t think this is a good excuse for a summaries-only feed. Most summaries-only feeds are just the first bit of content in the feed. However, most feed readers can already be configured to just display the first bit of content.

Another options is you could provide a summaries-only feed in addition to your full-text feed.

Yeah, generally I wouldn’t go for a summayr feed at all. I was just thinking if you publish many long posts frequently.

This is a very informative post, I am new to blogging and all I know and use is RSS.

Thankyou for making a few things clearer to me

There is an additional way to syndicate a site that should be better known: the h-entry / h-feed and microformat.

The site producer adds the h-entry and h-feed micformats in the HTML of the content itself, along with p-name, p-author, etc. The feed reader’s job is then to scrape the content page and look for these classes — there’s no alternative feed URL for the site producer to keep in sync, which I think makes this a better way.

Using the HTML itself for syndication rather than an additional file seems especially important these days because the newer Javascript-powered web systems cannot out XML as easily and flexibly as older PHP systems could. For example, you mention Nuxt on your list of site generators, but as a Nuxt user I know that feeds are an add-on module and set up individually in the nuxt.config.js file, not first-class functionality.

It seems to me that these microformats are a vital web standard.

This looks interesting and worth checking out. Right now it kinda looks like Schema.

I’m actually a newcomer to the RSS scene! I’ve heard people on the Obsidian Discord server talk about it and I decided to give it a shot. I absolutely love it! I’ve tried out NetNewsWire, Newsblur, and Feedbin. I think Feedbin is definitely my favorite, but I also use the others. I wish that I could export all the items in my feeds in NetNewsWire and Newsblur as easily as I can in Feedbin because some of the feeds I subscribe to are more active than others (though I did decide to mute one of the extremely active one in Newsblur a few hours ago). That’s the biggest flaw in both Newsblur and NetNewsWire for me.

NetNewsWire has an export feature in the settings.

You forget GRAV cms. It does all 3 very nicely and automatically for any sites that have content items.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

Copy and paste this code: micuno *

Leave this field empty

type= application/rssxml /

IMAGES

  1. PHP RSS Part10 Remove Links From XML Feeds

    type= application/rssxml /

  2. javax.ws.rs.ProcessingException, could not find writer for content-type application/json type

    type= application/rssxml /

  3. java

    type= application/rssxml /

  4. Adding the RSS service to your assets

    type= application/rssxml /

  5. What Are 5 Examples Of Application Software

    type= application/rssxml /

  6. java

    type= application/rssxml /

VIDEO

  1. Android RSS

  2. Building an RSS Reader part I

  3. Score! Walkthrough

  4. Labour Saving Lug Wrench Set (Long Type)

  5. مراجعة رياض محرز 89 حدث المئويين فيفا 23 😍| وتجربة الهيرو الجديد كينج 😨🔥| فيفا 23

  6. Introduction to R-Package semPLS

COMMENTS

  1. What is the correct MIME type to use for an RSS feed?

    RSS feeds should be served as application/rss+xml (RSS 1.0 is an RDF format, so it may be served as application/rdf+xml instead). Atom feeds

  2. application/rss+xml mimetype

    This type may also appear as. This type isn't known to appear as any other mime types. Further reading. No additional sources listed for this type.

  3. Feeds should not be served with the 'type/subtype' media type

    RSS feeds should be served as application/rss+xml (RSS 1.0 is an RDF format, so it may be served as application/rdf+xml instead). Atom feeds should use

  4. The Proper Content Type for XML Feeds

    The main reason people don't like text/xml is because its very vague, there are content types such as application/rss+xml , application/rdf+xml

  5. XML RSS

    child element is used to specify the language used to write your document.

  6. MIME Type Definition for RSS Files

    MIME type: application/rss+xml · File extension: .rss, .xml · Type of format: Syndication · Extended from: XML.

  7. feed_content_type()

    function feed_content_type( $type = '' ) { if ( empty( $type ) ) { $type = get_default_feed(); } $types = array( 'rss' => 'application/rss+xml'

  8. Sitemap HTTP-Header content-type aparenrly "application/rss+xml"

    Hi People, I am having a problem regarding the Content-Type of my sitemap. Aparently it is application/rss+xml, which we haven't modified at

  9. How to add a RSS feed to a Remix app

    Remix allows you to generate responses for any kind of page, ... app/routes/[rss.xml].tsx export type RssEntry = { title: string;

  10. RSS (file format)

    Screenshot of a RSS feed as seen in Mozilla Thunderbird. File extension: .rss, .xml. MIME type: application/rss+xml (unregistered). Extended from: XML

  11. Working With Web Feeds: It's More Than RSS

    <head> <link rel="alternate" type="application/rss+xml" href="https://codelab.farai.xyz/index.rss.xml" title="Farai's Codelab's RSS Feed"