How to Create an XML Feed

Make your own RSS feed with this XML guide

Really Simple Syndication (RSS) provides both professionals and novices a way to market their websites. While it's easy to associate an RSS feed with news agencies only, the truth is that RSS works for any website that continually changes or adds new content.

Applications that feed RSS use the XML structure to deliver data. Creating an XML document to promote your blog or pages via an RSS feed is something that anyone with a basic understanding of XML can do.

Tip: See our Anatomy of an RSS File for some more information on RSS feeds.

Set Up the Elements

A few elements are standard for an RSS feed:

  • Title
  • Description
  • Link

For example, if you wanted to create an RSS feed that highlighted Web Design content on ThoughtCo.com, you would need elements like this:


Learn Web Design at ThoughtCo.com

Exciting new offerings from the world of Web Design and ThoughtCo.com

https://www.thoughtco.com/web-design-4133459

Item Tag

RSS uses some specific elements to distinguish itself. One entry is the tag, which in the present example, is used as follows:

Learn Web Design at ThoughtCo.com

Exciting new offerings from the world of Web Design and ThoughtCo.comhttps://www.thoughtco.com/web-design-4133459

The elements for every page listed in the feed nest within a tag. RSS allows you to showcase more than one content page at a time by providing a new "item" set, like this:

Learn Web Design at ThoughtCo.com
Exciting new offerings from the world of Web Design and ThoughtCo.comhttps://www.thoughtco.com/web-design-4133459

The Best Free HTML Editors for Windows
HTML editors for web pages don't have to cost a lot to be goodhttps://www.thoughtco.com/best-free-html-editors-for-windows-3471313

Channel Tag

An RSS reader, or news aggregator, must hash out a lot of information in a short period. To accomplish this task, they separate the files into channels. Just like channels on a TV, this tag divides each feed.

You can implement channels with the opening tag and closing tag. Use them to contain the tag, as follows:




... [content goes here, like the title, description, and link shown above]


XML Declaration and RSS Version

All XML documents must have an opening declaration statement:

Additionally, XML created for an RSS feed must use as the root element and list the version. In current feeds, that will probably be 2.0. You should look through the documentation provided by your RSS reader and use the version required by the site.

 

Once you complete the XML code, save the document using the .XML file extension and upload it to the aggregator of your choice.

Here's an example of what our sample RSS feed might look like:





Learn Web Design at ThoughtCo.com
Exciting new offerings from the world of Web Design and ThoughtCo.comhttps://www.thoughtco.com/web-design-4133459

 The Best Free HTML Editors for Windows
HTML editors for web pages don't have to cost a lot to be goodhttps://www.thoughtco.com/best-free-html-editors-for-windows-3471313