Enhancing an RSS Feed Channel

Optional elements to make your syndicated feed better.

There’s so much more that a syndicated feed can be beyond a list of links and descriptions.

Optional Channel Elements

Channel identification elements

  • <image>
  • <managingEditor>
  • <webMaster>
  • <language>
  • <category>
  • <copyright>

Publication date elements

  • <pubDate>
  • <lastBuildDate>

Feed reader instructions

  • <skipDays>
  • <skipHours>
  • <ttl>

Channel Identification Elements

The channel identification elements are all grouped around meta data regarding your channel.

<image>

The <image> element goes towards the top of your file and provides a channel logo and link for the feed. This could be you normal website logo, or a new logo just for the feed.

<image>
  <url>https://www.htmlhobbyist.com/html-hobbyist-rss.png</url>
  <link>https://www.htmlhobbyist.com/</link>
</image>

Image must be in the GIF, JPEG or PNG formats or it will not validate. WEBP and SVG images have worked in every RSS feed reader that I’ve checked, but use these formats at your own risk.

<category>

Designates categories for the feed. Mainly used so that feed aggregators can list similar feeds together. Each category for your feed gets listed in its own element. You may have more than one category listed in your channel.

<category>HTML</category>
<category>Web Development</category>
<category>World Wide Web</category>
<category>Internet Culture</category>
<category>Hobbies</category>

The category element can contain a domain attribute thet helps to identify the context of the category.

<category domain="http://www.nytimes.com/namespaces/keywords/des">Computers and the Internet</category>

<language>

Indicates the language that the feed is written for by using a two letter code (ISO 639-1 Language Code Reference). Regional variants are indicated with a dash followed by another two letter code. American English would use the code en-US, whereas British English would use the code en-GB, though there isn’t much difference from en for “generic” english.

<language>en</language>

<copyright>

Copyright date and owner name for the feed.

<copyright>&#x00A9;2024 by N.E.Lilly</copyright>

<managingEditor>

The email address for the person who manages the content of the syndicated feed, sometimes including the name.

<managingEditor>editor@noreply.htmlhobbiyst.com (N.E. Lilly)</managingEditor>

Some feeds do not use this element to avoid exposing contact information to potential SPAM.

<webMaster>

The email address for the person who manages the technical aspects of the syndicated feed (sometimes including the name).

<webMaster>webmaster@noreply.htmlhobbiyst.com (N.E.Lilly)</webMaster>

Some feeds do not use this element to avoid exposing contact information to potential SPAM.

Time Elements

The date and time in an RSS feed must be an RFC-822 formatted date-time.

The RFC-822 date-time format is: a three character day of the week (which must match the date), followed by a comma, a two digit date, a three character month, a four digit year, and two digit hours, colon, two digit minutes, colon, two digit seconds, timezone designation.

The timezone designation should be a three character code, usually GMT, or an offset value from GMT: For example the Eastern Timezone offset would be +0400. If you’re running a feed for a local website whose visitors don’t span more than one timezone then it’s usually easiest just to use the local timezone or offset value.

Tue, 21 Jun 2022 00:00:00 GMT

<pubDate>

<pubDate>Tue, 21 Jun 2022 12:12:12 +0000</pubDate>

If you’re publishing a zine, this could indicate the date of your latest issue.

If you set the publication date to some future time, different feed readers may handle this in different ways. Well-behaved feed readers ignore the item until the time has come. Others may ignore the pubDate and simply display the items.

<lastBuildDate>

<lastBuildDate>Fri, 24 Jun 2022 12:12:12 +0000</lastBuildDate>

The <lastBuildDate> designates the last time that any of the content in the feed was updated.

Feed Reader Caching Instructions

Feed readers will cache (save for later) the syndicated feed and will periodically check to see if a feed has fresh content. Every time it checks for new content it downloads a copy of the feed. Each file itself is small, but multiply that over hundreds, thousands, or hundreds of thousands of feeds (for the more popular ones) and you could be using an incredible amout of bandwidth. Since it’s not likely that you’re running a 24 hour news feed, these caching instructions can allow you to let the feed reader know how often you expect to post updates to the feed. This can help reduce bandwidth use and load on your server. If you’re only updating the feed on a monthly basis, it’s a waste of bandwidth for feed readers to check your feed every hour.

<ttl>

The ttl element indicates how long, in minutes, a feed reader should cache a syndicated feed before checking for fresh items.

Common Time Spans
Hourly (minutes in an hour)
60
Daily (minutes in a day)
1440
Weekly (minutes in a week)
10080
Monthly (minutes in 30 days)
43800
<ttl>1440</ttl>

<skipHours>

The skipHours element allows you to tell feed readers in which hours you won’t have fresh content (in the UTC timezone).

This can also help you when you make updates to your feed. If you know that your current subscribers won’t be updating their feed until 7:00 in the morning EST, that can give you several hours to edit and check your feed to make sure the new items are added, correct, properly spelled, and properly validated before the feed readers will look for new items.

<skipHours>
  <hour>0</hour>
  <hour>1</hour>
  <hour>2</hour>
  <hour>3</hour>
  <hour>4</hour>
  <hour>5</hour>
  <hour>6</hour>
  <hour>7</hour>
  <hour>8</hour>
  <hour>9</hour>
  <hour>10</hour>
  <hour>11</hour>
  <hour>12</hour>
  <hour>22</hour>
  <hour>23</hour>
</skipHours>

<skipDays>

The skipDays element allows you to tell feed readers on which days you won’t have fresh content. If you know that you won’t have fresh content over the weekends, you could skip Saturdays and Sundays.

<skipDays>
  <day>Saturday</day>
  <day>Sunday</day>
</skipDays>

If you know that you will only have fresh content every Monday, you could skip every other day of the week.

<skipDays>
  <day>Tuesday</day>
  <day>Wednesday</day>
  <day>Thursday</day>
  <day>Friday</day>
  <day>Saturday</day>
  <day>Sunday</day>
</skipDays>

Be cautious about setting the time spans too far apart. Once a well-behaved feed reader has cached your feed there’s no reason for it to update again until the alloted time has passed.