Howto Create an RSS 2.0 Feed

September 13, 2005

If you can learn HTML, you can easily learn how to build your own RSS 2.0 feeds. I'll take you through the steps to creating an RSS feed from scratch.

Step 1: XML Declaration

Since RSS 2.0 must validate as XML, the first line in your rss feed must be the XML declaration.

<?xml version="1.0" encoding="utf-8"?>

The encoding is optional but recommended. If your using something other than UTF-8 be sure to change the above line.

Note: If you are using CFML and have whitespace due to the Application.cfm file you can reset the output buffer using <cfcontent reset="true">

Step 2: RSS Channel

In this step we need to open up the rss tag, and the channel tag, all of your feed content goes inside these tags.

<rss version="2.0">

Step 3: RSS Feed Information

Next you place information about your RSS feed such as the title of it, the description, and a link to the the site.

<title>The title of my RSS 2.0 Feed</title>
<description>This is my rss 2 feed description</description>
<lastBuildDate>Mon, 12 Sep 2005 18:37:00 GMT</lastBuildDate>

The lastBuildDate should be the date and time that the feed was last changed. Dates in RSS feeds should comply to RFC 822. In CFML the DateFormat mask would be ddd, dd mmm yyyy and the TimeFormat would be HH:mm:ss. Dates should be offset to GMT. The lastBuildDate tag is not required but is highly recommended.

Step 4: RSS Items

Next we enumerate over each RSS item, each item has a title, link, and description, publication date, and guid.

<title>Title of an item</title>
<pubDate>Mon, 12 Sep 2005 18:37:00 GMT</pubDate>
<description>[CDATA[ This is the description. ]]</description>
<!-- put more items here -->

Make sure you escape any characters that might cause your XML to invalidate, these characters include <, >, & - I like to enclose any content that may contain HTML inside a CDATA section.

Note: In CFML you can use the XmlFormat function to escape special characters in XML.

Step 5: Close Channel and RSS tags.


Step 6: Validate your feed

Validate your feed using

Other things to take note of

  • Content Type - See my post on content types for RSS feeds
  • Encoding - You should include the encoding in your Content-Type HTTP header, and in the XML declaration.
  • Styling - If you want to make your RSS feed look a little nicer you can CSS stylesheet for your RSS feed.
  • Categories - It's a good idea to include category tags in your RSS feeds as well, these go inside the item tag. You can give an item multiple categories by adding a tag for each one.

I have just scratched the surface of what you can do with RSS feeds, so check out the RSS 2.0 Spec for more info.

Related Entries

364 people found this page useful, what do you think?



Thanks for this great information as always. Your CF Cookbook is an awesome resource as well. I assume the answer to the following question is "yes" but figured I'd ask anyway before delving in, as you will likely know the answer off the top of your head. You alluded to this in your posting... is it possible to evaluate cfml variables inside of the RSS <item> tags? For instance: <item> <title><cfouptput>#feed1title#</cfoutput></title> <link><cfouptput>#feed1link#</cfoutput></link> <guid><cfouptput>#feed1guid#</cfoutput></guid> <pubDate><cfouptput>#feed1pubDate#</cfoutput></pubDate> <description><![CDATA[ This is the description. ]]></description> </item> Thanks again for helping with the understanding of this powerful capability.
Also handy is to place the following tag in the headsection of your RSS <ttl>60</ttl> This wil make sure that an RSS reader does not read your feed more then 1 time every 60 minutes. (feeddemon etc...)
Hi Mark, Thanks! Yes you can generate an RSS feed with CFML variables just like you would a HTML page with CFML. So suppose you have a db table with company news. If you wanted to create a RSS feed for that you would do a <cfoutput query="news"> <item> ...</item></cfoutput> One thing to keep in mind is that all the content inside the tags needs to be XML save, so you either want to use CDATA or XmlFormat or both.
Tjarko, Yes the TTL feature is very handy, I omitted it from this example because I didn't want to overload people with details. Also handy is the skipDays, skipHours tags, if your a business and you only update the content on weekdays you can tell readers to take the weekend off.
Pete, Many thanks for the reply and great info. I am working on getting my first feed up and running in the next 5 weeks (among other work) and this is a great head-start/ encouraging questions. Thanks and cheers-
Thanks. I was looking for something like this recently
Or you could use a service such as Nooked, or FeedForAll A whole lot easier...
Thanks for these links, Bill. ...easier to use these services, well, maybe in the short term. It depends on what you want to do with RSS, what your goals are. Understanding the technology and how to create feeds makes it "easier" to leverage in your site(s), through automation, etc. Thanks again, Pete, for the great references. Looking forward to the next post.
excellent 'how to.' just wanted to alert you to a free application that will create an xml file automatically. you just have to input your information. it's called, RSS WRITER and you can find it here:
check out to build dynamic RSS feeds using java.
Hi there, I have finished my RSS feed, tested it and all works perfectly, but when I remove an article from my feed it still showed in the reader. How do i get the reader to see the article is no longer part of the feed. When using firefox Sage extension the reader notifies that the change has been made and removes the no longer available feeds. Whereas when using FeedReader, Feed Demon etc, this is not the case. If someone could please help that would be great. Thank you in advance
Hi there, I have finished my RSS feed, tested it and all works perfectly, but when I remove an article from my feed it still showed in the reader. How do i get the reader to see the article is no longer part of the feed. When using firefox Sage extension the reader notifies that the change has been made and removes the no longer available feeds. Whereas when using FeedReader, Feed Demon etc, this is not the case. If someone could please help that would be great. Thank you in advance
George, I think that depends on the reader - most of them will store a copy locally. So once you publish something to your RSS feed, you can remove it but some people will still get it - it's kind of like sending an email.
Need help creating RSS 2.0 feeds for podcasting? Try this FREE online tool to help create your first RSS 2.0 XML file!
Hello, I'm very new to using RSS, I have one fundamental question: How do I ensure that RSS readers update my feed when I update it? I author a financial news RSS feed and it's important that new stories are updated promptly. Can you help?
Jamesy, most rss readers will grab your feed every hour. You can use the ttl tag to specify a time to live for your feed, they will obey that if it is set higher than one hour, and some readers may grab it more often if it is set below an hour.
Thank you for the lucid response. It is possible to specify a specific date to check for updates. I ask because my rss feed is updated once weekly at the same time each week. - Thank you
Jamsey, Yes, you can specify skip days, and skip hours in your rss feed as well, aggregators should not download your feed on a skip day or skip hour. See: for details.
Nice comments about RSS. Thanks, I've now made my feed:
Hi everybody. I have a question about Feeds. I'm developing a Feed Reader, and I have to update the feeds, but I don't know how to do it. I'm working with java Rome. I'm guessing I can do it considering pubDate and the current date. I compare both dates to check if there are changes in those feeds. If you have a better idea, please advice me, I'll be thankful.
hi, I have some questions, I tried something about rss ut I couldnt have what I want. I want to have rss same as down simple, with link . Have can I create it same ? If somebody can help me I will be very happy. Thanks. sorry for my english :(
Is there any comparable RSS 2.0 tag to the <itunes:block> tag? I've redone my feeds, but the old ones still show up in aggregators and would like to eliminate them. Is there a way to do that with Yahoo Podcasts?
Hi everbody. Firefox rss read icon view -0.92 update rss 2.0 ? -0.92 code change ? -page add code ?
Alright, i am extremly new to rss. I've made my feed and now i have a problem. I have absoloutly no idea what to do next. How do i go about adding this feed to a webpage. Is it just like adding a bit of html. But most importantly, if anyone has a pda and knows of the program "Avantgo" i really need some help on how i can allow users to use it to find my channel. Sorry for the frustratingly ignorant questions.
I have created a feed. I want to know how to publish my feed, for my users to know, without using the Feed Readers available on the net. Please help me.
Thanks for this useful tutorial, it has helped me build my own feed in no time.
Is there a program that will automatically update my RSS feed for viewers when there are new articles placed on the site? Thanks!
hi, im using to publish my feed.. its easy and simple with ther web based system...
hi, thanx for your useful help i have tow questions : 1. How can I generate rss without this error by validators? : <i>should not be served with the "text/html" media type</i><br> this is my rss : 2. how can i use html in contents of "description" tag? i don't know how can i use CDATA
psps can use rss's im on one now
Thanks for this sharing. I will try to install this on my sites.
I am in the process of opening an Yahoo store built with Yahoo Store Editor and even though the web design tools include and "Add On" feature and talk you through putting an RSS feed onto your store site, it doesn't work. I can perform all the directions and cut the html for the news section I want to put on my site, but then the directions become unclear as to WHERE TO PASTE IT! A call to Yahoo tech service said, "Oh, you can't really put an RSS feed on your site with those directions and I don't know how to do it either". Can that possibly be true??
Useful! I will create one for our motorcycle tour site. Many thanks.
Thank you in advance
How do I have a feed without a <link> tag?
I am somewhat new at this. If I create an xml document for the RSS feed with CF variables, it will need to be saved as a .cfm document. How do I define the resulting output to be .xml instead of .html after parsing by the CFServer?
Stacy, as far as software that will automatically update your feed, checkout PodAdmin: You put it on your web server (requires PHP), and it will parse out MP3 files and update your RSS file accordingly.
what do you save the rss file as?
You can name your feed file anything. You can even generate your feed dynamically! The only important thing is that the correct XML is returned when someone visits your feed URL. I often use perl scripts, Java Server Pages, and ASP Class Libraries to generate feeds. To get users to your feed, you can use several methods. One is to just tell them the URL (http://mysite/ OR http://mysite/myfeed.xml). You can also provide a hyperlink to the url (the XML/RSS image works great for this). Lastly, you can tell browsers that there is a feed associated with your webpage by adding the feed's URL to the header section of your webpage (remove spaces as needed): < head > < link rel="alternate" type="application/rss+xml" title="My Feed" href="http://mysite/myfeed.xml" /> </ head >
I'm sorry but your instructions were incomplete. all you have are code snippets, but if someone like me for example, has no idea where to put them, what they are supposed to do, or what to save the file as (xml or cfml) all I get is, nothing from this at all. I need the whole thing coded out from top to bottm, what you are saving each page as, and how exactly do I get the feed to post on my page anyway, I got a link, and so what? how do I make that link post something on my site? It validated very well, but did nothing. I ended up going in circles, I even made and xsl sheet to try and get it to do something, and I got nothing. So whatever. I just need more detailed instructions. You have these code snippets and they are just hanging in the air. Which is probably why so many people have written something to you. It's just too vague. Sorry for the criticism but...I just wasted a half hour of my life for nothing on this. when I "could" be making money.
Thanks. Question: I'm wondering if we really need to use the www prefix, at the beginning of the URL. Example, are those lines the same? <link></link> and, <link></link>
Why not use software rather than handcoding a feed? There are so many good tools out there I use FeedForAll and it saves a whole lot of time and effort.
I have managed to integrate an RSS 2.0 ASP script (similar to one found at which retrieves RSS news feeds with a Dynamic Drive horizontal scroller, you can view a working example of this at The question I would like to ask is: Is there any way of retrieving the whole news article and any associated images and not just the Title, Link and Description within the ASP script, so when the user clicks on the link they will be able to read the news item on a page on my site? I will of course ask the BBC for permission to do this. Thanking you in advance.
ive been trying to get images in my items,to output into my phone. but have been failing everytime. i have even tried src='loadimg.php?file=example.jpg'but somehow it doesnt seem to work, have seen a good example on anyone has a solution?
you have a little mistake in your item definition CDATA section starts with "<![CDATA[" and ends with "]]>": but thanks for the rest, it saved me a lot of time ;)
Currently I have been using an RSS publication application called Flaremaker. I wanted to find an application that would allow me to easily create my own feeds and publish them on my own website. Within minutes I had entered in the content and it produced a snip bit of code to put into my site. It?s so easy. It also allows me to track all the items in my feeds. Flaremaker is a Very Cool application. Check it out
Hey, I'm a 17 year old that has a PodCast on my school's website and I am looking for help on how to connect an RSS Feed to the PodCast on the website so that iTunes will pick up the tag whenever someone searches on iTunes. Please Help, I'm Totally LOST!!! Thanks!!
Thanks! As a coder that needed to create a dynamic feed, and so can't use any of the popular RSS-generators, this post helped me very much! It was the first page out of 15 that I looked at the explained how to do it clearly and succinctly. This should be ranked at the top of google when searching for how to code RSS feeds. Thanks again!
hey guys! thanks for all this.. but i m really new in RSS WORLD :) will guys please help me out about this.. where should i start? where i have my site which update its news section on almost daily bases.. thank you!
also i would like to tell you that my site is written in asp (not .net). Is it possible to write asp generated data for RSS?
Hey, Thanx needed sumthin simple like this
well its all fine, but i really want to know how can we write an XML file may be RSS.XML using any programing languag, my prior langs are ASP, .ASP etc. thanks!
There's a website at that allows you to create an RSS/Atom feed for any website. Pop the URL in and the rest is done automatically! Its very easy and doesn't require registration. Could save some headaches!
This stuff did not work AT ALL. My feed validator keeps giving me errors. Really aggrivating. Really aggrivating.
Feedity ( seems to be a much simpler and quicker tool at building instant custom RSS feeds fro ANY webpage.
I'm definitely a newbie. Please help, if this is possible. Unfortunately, there are several parts to my question: If a file is updated (or uploaded) in a folder on the server. Is it possible to have an RSS feed show that updated or new file and have a hyperlink to it? Is it possible to have the RSS Reader integrated into my webpage so no client specific software is loaded? (What's a good reader for this?) Is it possible to have the rss feed checked every minute? I want updated stuff to be shown immediately. Thanks!
Hi, I'm a newbie to RSS. I am creating a tool to read rss. Is there anyway i can know when a particular rss will get updated or do i have to reload the whole rss again after some time?
is rome compatible to tomcat to install rome? and jdom?. where to extract those jdom and rome folders.. Thanks.
i am trying to build a RSS feed for my year 11 IPT assignment and i am not sure if i am doing the right thing. I dont what to put in the link part since my website has not been published. Am i able to put it on my website even though it is not published. Thanks
Awesome very easy to understand.
Thanks for the awesome crash-course in RSS Feeds. I do have one question: Is there any simple way to have my rss.xml file be automatically updated, or do I have to manually enter each item? Thanks again!
Hi, I did my website by dreamweaver and I don't know anything about programming. So I don't know how to start to make a rss 2.0 feed. Can I create it in dreamweaver or wordpad or another software? Could you please tell me in plain details step by step. Thank you so much
""When using firefox Sage extension the reader notifies that the change has been made and removes the no longer available feeds."" thank you for this.
The quality of education is, is not lower than 15 years ago
Hi. am new to blog and am finding it so difficult to post and i can't viewing my site in order to know where i can still proceed. also don't no mush about rss feed. pls help, thanks. from Nigeria.
Hy, i am new in using and searching more informations about rss,i need to get adviced,regarding a few sites for help and to lern how to update the news. Thank you! wiew my e mail adress!!
Cool Tip on Howto Create an RSS 2.0 Feed Testing it
I am using an xsl schema for my RSS feed, if a perticular feed is down. I need to know how to handle it gracefully so I dont show a nasty error message to the user. Is there a way to show a handled/custom error message if a feed is down??
I want to make a new line in only one description tag, but it display whole text in justify form. So tell me how i can create a new line without creating new description tag. such like a below. e.g. New News. \\Then new Line and print Another News.
so after creating this rss.xml, where should I put it so that the world can get it?
What script do you use to add a Icon to your XML document? this is an example of how to add images too to an rss feed.
nice tips but how to make a feed for the website not blog reply
Thank you! I couldn't get my description to support html until i added an exclamation mark on this line <description><![CDATA[ This is the description. ]]</description>
Here's another nice atricle on how to create a rss feed:
thanks I followed this, and it worked right off the bat, the only error is "<description><![CDATA[ This is the description. ]]</description>" all you babies need stop crying and learn how to read,
I found this through google and noticed a lot of comments weren't answered. I posted a simple but full code example and some info--based on Pete's helpful overview here-- on my blog: dated 2/22/2009, I don't think the comments will let me paste the whole long link in here but I'll try:
This was easy. However, validating the feed, the validator also suggested "xmlns:atom="" to be added to <rss version="2.0">. As well as adding <atom:link href="" rel="self" type="application/rss+xml" /> just before the first <item>. This seems to help the widest range of readers to parse it.
I have issue in the title with double quotes. It did not display property. The double quotes display square instead. Any ideas how to fix it? Thanks...
Thanks, very efficient.
Yes. ">avril lavine nude</a>
I have a years worth of info that needs to be distributed weekly. There is a possibility that some of the info will change in the future but most is set. Is an RSS feed the tool to use or is there a better option?
Tip: For anybody who wants to write atom namespace extended RSS 2.0 feeds in plain text - try this link
Hi! thanks for your article :) My question is: is possible to add an image at the item? thanks very much! bye bye
Hi. Good article, but I use another grate program: RSS Channel Writer.
Cool Tip I'll try add it at my web
Might be worth it to mention - beyond the format, if you want to get the Time in the Standard format - you can use this format: #dateformat(DateConvert('local2utc',now()),'ddd, dd mmm yyyy HH:mm:ss')# GMT
This is a great tutorial - Thanks
Useful tutorial thanks, although as mentioned above, services like and take a lot of the hassle out of making and maintaining your own rss feed and also provide usage stats and other widgets to help your users keep up to date with your updates.
Hi Ray, I have been looking for recommendations on handling times in RSS feeds. Particularly, I am writing in the GMT time, but apparently somewhere, somehow, we need to offset this time to be correect for the person hitting the feed. I heard this can be done in CF, but I don't know if this needs to happen at the server... or how it's best done. Thanks for any links or suggestions. Jason
You can create RSS feeds wothout coding... 100% Free at

It's Awesome... You can also subscribe to rss feeds as well...
You can make RSS feeds and podcasts for free without code at
Hi Pete,

Thanks for this great information. I am using the following Php class to generate RSS feeds from my website (RSS2Writer):

In relation to your statement "Dates in RSS feeds should comply to RFC 822...", I have my feeds working usinf the XML date format (ISO 8601): YYYY-MM-DDThh:mmZ , YYYY-MM-DDThh:mm+04:00, etc.
Is ISO 8601 supported in RSS as well as RFC 822, or are my feeds working working because it ISO 8601 a common format used in XML and is accepted in RSS, but not recommended?


I had everything working but no images. Wasn't sure about CDATA. Now I got images! Thanks for the info. Nice!
You guys are the most innovative content distributors on the web, and I think you guys could check this site out and make a credit of it.
Emergency Soft has just released a new version of RSS Channel Writer. This comprehensive, yet easy-to-use software promises to be the most professional in its field.
hi guys. i'm sorry but i really don't understand how to add images to my feed posts. i only get text at the moment. could you help?
Hello axelk,
You can add images to your feeds by using the description tag of Item.
Here is an example..

<description><![CDATA[<img src= align=left alt='DVD Cover'/> An image from W3Schools ]]></description>
Hello axelk,
You can add images to your feeds by using the description tag of Item.
Here is an example..

<description><![CDATA[<img src= align=left alt='DVD Cover'/> An image from W3Schools ]]></description>
This site helped. I couldn't find anything with a better step-by-step description of how to make one.
societies president extinctions running issue impact beginning
?????? ?????????? ????? 766-12-13. ? ?????? ? ???????.
?????????? ???? ? ?????? ? ??????? ?? ???? ?????? – ???????, ????????? ? ??????????

i am using rss v 2.0. i am trying to implement feed with input box. for that i have used <textinput> tag in channel tag. i have validated my rss. no errors came. but in my browser i am not able to see the input box with a button beside it. what is the problem in this.

Thank you on this post!
Great article, but I needed a little more info. I have a static HTML website and I have been using feedburner for a while. I coded my rss feed on my own and then added it to feedburner. It is pretty basic, but it does work.

Now, the question is: I would like to give away a free ebook to my email subscribers. The download link should appear in the feed and nowhere else.
How do I get feedburner to display the same download link in all of my feeds? Doesn't feedburner automatically remove old links from new feeds. Any help is appreciated.

thanks in advance
Thanks a lot
I would like to exchange links with your site
Is this possible?
I just sent this post to a bunch of my friends as I agree with most of what you’re saying here and the way you’ve presented it is awesome.
I have created an rss feed for my site for testing but don't know how to update it automatically.

When a new post is made or page is added why the feed is not updates. Please advice.

Thanks in advance
I have created an rss feed for my site for testing but don't know how to update it automatically.

When a new post is made or page is added why the feed is not updates. Please advice.

Thanks in advance
Sorry, I may sound like an idiot, I'm new to this.

But do you or can you just post all of these codes in the Css/Html Source Coding?

Or where do you plug these codes into?
You can directly write them in notepad and save the file as anyname.xml
.xml extension is must because you are making it in the xml.

and also look carefully for the tutorial for help you will understand what i am saying.

ANG Designers
<object width="480" height="385"><param name="movie" value=";hl=ru_RU&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src=";hl=ru_RU&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>
????????? ?????
Great Blog. I add this Post to my bookmarks.
Just noticed that the code shown does not include <pubDate></pubDate> which was needed to make my feed work with various services. So this is for anyone else who noticed that it breaks things like MailChimp RSS automation and correct dates in IE.
I want a full bible on my phone

I found this blog very inetersting and will bookmark
ipage hosting information
Nice tip... Will try this to my personal site.
cheap virtual private server - America
thank you for information
justhost hosting cheap webhosting.
xml is simple and is widly used in rss and android. Learning this is good.
how i can add cdata in channal title.Please solve this problem .
how i can wrap the name of the channel in cdata
Thank You very much. That's the 1st time I never created my 1st news feed. Thank you

It is grateful for the help in this question how I can thank you?
You commit an error. I can defend the position. Write to me in PM.
Many thanks how I can thank you? - Nike Free Run+ 3 Dame
You have hit the mark. I think, what is it excellent thought.
Great site, i love
:( gnu kA Jake joke Jake kA Jo junky junky juke
i want to add dynamic date in <pubDate>

Please help

Thanks in advance

Post a Comment


Spell Checker by Foundeo

Recent Entries


did you hack my cf?