---
title: Creating custom RSS feed pages manually
related:
  - https://docs.kentico.com/k9/developing-websites/loading-and-displaying-data-on-websites/displaying-data-advanced-scenarios/setting-up-syndication-feeds.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

It is possible to create a dedicated page with an RSS feed instead of using web parts. This way of creating RSS feeds is **obsolete** now, as syndication web parts provide a much more convenient way of creating RSS feeds.

The default installation contains a simple **CMSPages\NewsRss.aspx** page which shows how to build your own RSS feed. It works with _news_ items, but you can modify the code so that it displays a different type of pages.

The following code example shows the code of the _NewsRss.aspx_ page.

> **Note:** If you installed the Kentico project as a **web application**, you need to rename the _CodeFile_ property on the first line to _Codebehind_ for the code example to be functional.

```html

<%@ Page Language="C#" AutoEventWireup="true" Inherits="CMSPages_NewsRss" CodeFile="NewsRss.aspx.cs" %>
<rss version="2.0">
 <channel>
  <title>News RSS</title>
 <link><![CDATA[<%=HttpContext.Current.Request.Url.AbsoluteUri.Remove(HttpContext.Current.Request.Url.AbsoluteUri.Length - HttpContext.Current.Request.Url.PathAndQuery.Length) + HttpContext.Current.Request.ApplicationPath%>]]></link> 
  <description>News RSS Feed</description>  

  <cms:cmsrepeater ID="NewsRepeater" runat="server" OrderBy="NewsReleaseDate DESC" ClassNames="cms.news"
   TransformationName="cms.news.rssitem" SelectedItemTransformationName="cms.news.rssitem"
   Path="/news/%" WhereCondition="NewsReleaseDate < GetDate()"></cms:cmsrepeater>   
 </channel>
</rss>

```

The page contains only RSS elements with dynamic code. The RSS items are rendered using a _CMSRepeater_ control with appropriate transformation.

The code behind looks like this:

```csharp title="C#"

using CMS.UIControls;

public partial class CMSPages_NewsRss : XMLPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.ContentType = "text/xml";
    }
}

```

This code changes the output content type to XML.

## How to create an RSS feed page for a different page type

If you want to display articles instead of news in your RSS feed, follow these steps:

1. Create a new ASPX page called articles\_rss.aspx.
2. Copy and paste all code from the _NewsRss.aspx_ file except for the  directive.
3. Change the following properties of the CMSRepeater control:
   - **OrderBy**: DocumentModifiedWhen DESC
   - **ClassName**: cms.article
   - **TransformationName**: cms.article.rssitem
   - **SelectedItemTransformationName**: cms.article.rssitem
   - **Path**: /%
   - **WhereCondition**: leave empty
4. Add the same line of code as used in the _NewsRss.aspx.cs_ code behind file (_Response.ContentType = "text/xml"_) to articles\_rss.aspx.cs.
5. Create the [trasformation](https://docs.kentico.com/k9/developing-websites/loading-and-displaying-data-on-websites/displaying-data-advanced-scenarios/setting-up-syndication-feeds/syndication-transformations.md) **cms.article.rssitem** in the Kentico administration interface (**Page Types -> edit -> Transformations**):

   ```html

   <item>
        <guid isPermaLink="true"><![CDATA[<%# GetAbsoluteUrl(GetDocumentUrl()) %>]]></guid>
        <title><![CDATA[<%# Eval("ArticleTitle") %>]]></title>
        <description><![CDATA[<%# Eval("ArticleText") %>]]></description>
        <pubDate><%# Convert.ToDateTime(Eval("DocumentModifiedWhen")).ToString("r") %></pubDate>
        <link><![CDATA[<%# GetAbsoluteUrl(GetDocumentUrl()) %>]]></link>    
   </item>

   ```
