RSS Feed

This document is for a version of Craft CMS that is no longer supported. Please refer to the latest version →

The following template can be used to provide a RSS 2.0 feed on your site. It assumes that you have a global set with the handle “globals”, with a field called “siteDescription”.

If you save this in a template that ends with a “.rss” file extension, Craft will even serve it with an application/rss+xml MIME type.

<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="">
    <title>{{ siteName }}</title>
    <link>{{ siteUrl }}</link>
    <atom:link href="{{ url(craft.request.path) }}" rel="self" type="application/rss+xml" />
    <description>{{ globals.siteDescription }}</description>
    <pubDate>{{ now.rss }}</pubDate>
    <lastBuildDate>{{ now.rss }}</lastBuildDate>

    {% for entry in craft.entries.find() %}
        <title>{{ entry.title }}</title>
        <link>{{ entry.url }}</link>
        <pubDate>{{ entry.postDate.rss }}</pubDate>
        <author>{{ }}</author>
        <guid>{{ entry.url }}</guid>
          {{ entry.body }}
    {% endfor %}