RSS is an XML structure that contains the below items

  • First line is an <?xml version="1.0" encoding="UTF-8" ?>

  • is a root element that contains version number and namespace <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">

  • : Contains metadata about fields

    • <title>: Blog Title
    • <link>: Link to website
    • <description>: Description
    • <generator>: App or program used to generate a feed, Optional
    • <language>: language used for a website page, Optional
    • <managingEditor>: Email address Content Editor, Optional
  • <item>: Specify individual content in a RSS feed

    • <title>: item page Title
    • <link>: Link to content page
    • <description>: Description
    • <pubDate> : Published Date

Here is an RSS XML example

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Blog RSS Feed</title>
    <link>http://www.w3schools.io</link>
    <description>This is an example  Blog RSS feed.</description>

    <item>
      <title>Blog article Title 1</title>
      <link>http://www.w3schools.io/article1</link>
      <description>Article description.</description>
      <pubDate>Sun, 01 Jan 2023 12:00:00 GMT</pubDate>
    </item>

    <item>
      <title>Blog article Title 2</title>
      <link>http://www.w3schools.io/article2</link>
      <description>Article description.</description>
      <pubDate>Mon, 02 Jan 2023 12:00:00 GMT</pubDate>
    </item>

    <!-- More articles... -->

  </channel>
</rss>

How browsers understand for a Website RSS feed

Once the RSS feed is created in feed.xml, You have to tell the browser.

One way, using a link tag.

<link rel="alternate" type="application/rss+xml"
  href="https://www.w3schools.io/rss.xml" title="Your title">

Another way, using robots.txt with a sitemap field

Sitemap: https://www.w3schools.io/rss.xml