Bundled Plugins

Ava CMS comes with a few helpful plugins to handle common tasks. They're installed by default but you can enable or disable them in your config.

These plugins also serve as good examples and code references if you want to build your own — see Creating Plugins.

Sitemap

Automatically generates an XML sitemap for search engines like Google.

  • What it does: Creates a sitemap.xml index that links to individual sitemaps for each content type (e.g., /sitemap-page.xml).
  • How to use: Just enable it in app/config/ava.php.
  • Customisation: You can exclude pages by adding noindex: true to their frontmatter.
  • Automation: Automatically adds the Sitemap URL to your robots.txt when you rebuild the site.
  • Admin Interface: View sitemap statistics and status directly in the Admin Panel under Plugins > Sitemap.

Behavior

  • Robots handling: On every index rebuild the plugin will check public/robots.txt:
    • Create robots.txt if it doesn't exist (with sensible defaults).
    • Add or update the Sitemap: <url> line to match your site.base_url config.
    • Preserve existing User-agent and Allow rules when updating.

Configuration

First, ensure 'sitemap' is in your plugins array:

// app/config/ava.php
'plugins' => [
    'sitemap',
    // ... other plugins
],

CLI Commands

sitemap:stats

Show sitemap statistics including URL counts per content type.

./ava sitemap:stats
  ─── Sitemap Statistics ──────────────────────────────

  Content Type  Indexable  Noindex  Sitemap File       
  ─────────────────────────────────────────────────────
  page          5          1        /sitemap-page.xml  
  post          12         0        /sitemap-post.xml  

   Total URLs in sitemap: 17
   Main sitemap: https://example.com/sitemap.xml

RSS Feed

Lets people subscribe to your blog using an RSS reader.

  • What it does: Creates feed.xml with your latest posts, plus per-content-type feeds (e.g., /feed/page.xml).
  • How to use: Enable it in app/config/ava.php.
  • Customisation: Choose which content types to include and whether to show full content or excerpts.

Configuration

First, ensure 'feed' is in your plugins array:

// app/config/ava.php
'plugins' => [
    'feed',
    // ... other plugins
],

Then optionally configure:

'feed' => [
    'enabled' => true,
    'items_per_feed' => 20,
    'full_content' => false,  // true = full HTML, false = excerpt only
    'types' => null,          // null = all types, or ['post'] for specific types
],
Option Default Description
enabled true Enable or disable feed generation
items_per_feed 20 Maximum items per feed
full_content false true = full rendered HTML, false = excerpt only
types null Which content types to include (null = all, or array like ['post'])

Adding to Your Theme

Add the feed link to your theme's <head>:

<link rel="alternate" type="application/rss+xml" 
      title="My Site" 
      href="/feed.xml">

CLI Commands

feed:stats

Show RSS feed statistics and configuration.

./ava feed:stats
  ─── RSS Feed Statistics ─────────────────────────────

  Content Type  Total Items  In Feed  Feed URL        
  ────────────────────────────────────────────────────
  page          5            5        /feed/page.xml  
  post          12           12       /feed/post.xml  

   Items per feed: 20
   Content mode: Excerpt only
   Main feed: https://example.com/feed.xml

Output Example

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>My Ava CMS Site</title>
  <link>https://example.com</link>
  <description>Latest content from My Ava CMS Site</description>
  <atom:link href="https://example.com/feed.xml" rel="self" type="application/rss+xml"/>
  <item>
    <title>My Latest Post</title>
    <link>https://example.com/blog/my-latest-post</link>
    <guid isPermaLink="true">https://example.com/blog/my-latest-post</guid>
    <pubDate>Mon, 20 Jan 2025 12:00:00 +0000</pubDate>
    <description>Post excerpt or full content...</description>
  </item>
</channel>
</rss>

Redirects

Manage custom URL redirects and status responses through the admin UI or CLI.

  • What it does: Redirects old URLs to new ones, or returns status-only responses (like 410 Gone).
  • How to use: Enable the plugin, then use the admin dashboard or CLI commands.
  • Storage: Redirects are saved to storage/redirects.json.

Features

  • CLI management — Add and remove redirects via command line
  • Multiple status codes — Supports redirects (301, 302, 307, 308) and status-only responses (410, 418, 451, 503)
  • High priority — Processed before content routing
  • Security validation — Blocks redirects from admin paths and existing content
  • Admin page — Manage redirects under Plugins → Redirects

Enabling

Add 'redirects' to your plugins array:

// app/config/ava.php
'plugins' => [
    'redirects',
    // ... other plugins
],

This plugin has no additional configuration options—just enable it and use the admin UI or CLI to manage redirects.

When to Use

Redirect Type Use Case
301 Permanent Content moved permanently, SEO-friendly
302 Temporary Temporary redirect, not cached

Comparison with Content Redirects

Ava CMS supports two ways to redirect:

Method Best For
Redirects Plugin External URLs, legacy paths, quick fixes
redirect_from frontmatter Content that's been moved/renamed

Using redirect_from in content:

---
title: New Page Location
redirect_from:
  - /old-url
  - /another-old-url
---

CLI Commands

redirects:list

List all configured redirects.

./ava redirects:list

With redirects configured:

  ─── Configured Redirects ────────────────────────────

  From          To             Code  Type              
  ────────────────────────────────────────────────────
  /old-page     /new-page      301   Moved Permanently 
  /legacy       /modern        302   Found (Temporary) 

   Total: 2 redirects

No redirects configured:

  ─── Configured Redirects ────────────────────────────

  ℹ No redirects configured.

redirects:add

Add a new redirect from the command line.

./ava redirects:add <from> <to> [code]

Arguments:

Argument Description
from Source path (e.g., /old-page)
to Destination URL (e.g., /new-page or https://...)
code HTTP status code (default: 301)

Supported Status Codes:

Code Type Description
301 Redirect Moved Permanently (SEO-friendly)
302 Redirect Found (Temporary)
307 Redirect Temporary Redirect (preserves method)
308 Redirect Permanent Redirect (preserves method)
410 Status Gone (content deleted)
418 Status I'm a Teapot ☕
451 Status Unavailable For Legal Reasons
503 Status Service Unavailable (maintenance)

Examples:

# Permanent redirect (301)
./ava redirects:add /old-page /new-page

# Temporary redirect (302)
./ava redirects:add /temp-redirect /target 302

# Mark page as permanently gone (410)
./ava redirects:add /deleted-page "" 410

# External redirect
./ava redirects:add /external https://example.com/page

redirects:remove

Remove a redirect.

./ava redirects:remove <from>

Example:

./ava redirects:remove /old-page
   Removed redirect: /old-page

Storage Format

Redirects are stored in storage/redirects.json:

[
  {
    "from": "/old-page",
    "to": "/new-page",
    "code": 301,
    "created": "2025-01-20 14:30:00"
  }
]

Enabling All Bundled Plugins

// app/config/ava.php
return [
    // ...
    
    'plugins' => [
        'sitemap',
        'feed',
        'redirects',
    ],
];

After enabling, rebuild the content index:

./ava rebuild

Then access the plugin admin pages at:

  • /admin/sitemap
  • /admin/feeds
  • /admin/redirects

Community Plugins

Looking for more plugins? Check out the Community Plugins page for plugins shared by other Ava CMS users.

Built a plugin you'd like to share? Submit it to the community gallery!