Generate a RSS/JSON-Feed from a Pages-Collection

Installs: 107

Dependents: 0

Suggesters: 0

Stars: 9

Watchers: 0

Forks: 1

Open Issues: 1


1.1.2 2019-05-13 14:13 UTC


GitHub release License Kirby Version Kirby 3 Pluginkit

Generate a RSS/JSON-Feed from a Pages-Collection.

Commercial Usage

This plugin is free but if you use it in a commercial project please consider to


  • unzip as folder site/plugins/kirby3-feed or
  • git submodule add site/plugins/kirby3-feed or
  • composer require bnomei/kirby3-feed


You can use this in a template for a dedicated feed page, in a template controller or a route.

$options = [
    'title'       => 'Latest articles',
    'description' => 'Read the latest news about our company',
    'link'        => 'blog'
echo page('blog')->children()->visible()->flip()->limit(10)->feed($options);

options array defaults

If you use these defaults you need to provide the fields date (type: date) and text (type: text).

    'url'         => site()->url(),
    'title'       => 'Feed',
    'description' => '',
    'link'        => site()->url(),
    'datefield'   => 'date',
    'textfield'   => 'text',
    'modified'    => time(),
    'snippet'     => 'feed/rss', // or 'feed/json

virtual page in site/config.php

return [
    'routes' => [
            'pattern' => 'feed',
            'method' => 'GET',
            'action'  => function () {
                $options = [
                    'title'       => 'Latest articles',
                    'description' => 'Read the latest news about our company',
                    'link'        => 'blog'
                $feed = page('blog')->children()->visible()->flip()->limit(10)->feed($options);
                return $feed;

HTML head element

rss xml

<link rel="alternate" type="application/rss+xml" title="Latest articles" href="<?= site()->url() ?>/feed"/>

or rss json

<link rel="alternate" type="application/json" title="Latest articles" href="<?= site()->url() ?>/feed"/>

Sorting by date

Using sortBy('date', 'desc') will not yield expected results! In K3 sorting by date needs a callback.

$feed = page('blog')->children()->visible()->sortBy(function ($page) {
 return $page->date()->toDate();
}, 'desc')->limit(10)->feed($options);



  • default: null to autodetect json or rss-xml otherwise enforce output with a certain mime type


  • default: 60*24*7 in minutes

The plugin will automatically devalidate the cache if any of the Page-Objects were modified. The plugin uses minutes not seconds since K3 Cache does that as well.


  • default: true force refresh if Kirbys global debug options is active


This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.



It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.


based on K2 versions of