PHPackages                             kozmozio/kirby-llms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kozmozio/kirby-llms

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

kozmozio/kirby-llms
===================

A Kirby CMS plugin that generates an llms.txt file for Large Language Models

1.0.4(4mo ago)92711MITPHP

Since Mar 7Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/kozmozio/kirby-llms)[ Packagist](https://packagist.org/packages/kozmozio/kirby-llms)[ Docs](https://github.com/kozmozio/kirby-llms#readme)[ RSS](/packages/kozmozio-kirby-llms/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Kozmoz Kirby LLMs Plugin
========================

[](#kozmoz-kirby-llms-plugin)

A Kirby CMS plugin that generates an `llms.txt` file in the root of your website or responds to the `llms.txt` route with necessary information for Large Language Models (LLMs)

[![Kirby LLMs Plugin Panel Interface](kozmoz-kirby-llms.jpg)](kozmoz-kirby-llms.jpg)

Overview
--------

[](#overview)

This plugin creates an `llms.txt` file that provides structured information about your website to help Large Language Models better understand and interact with your content. Similar to how `robots.txt` works for search engines, `llms.txt` provides guidance for LLMs.

Features
--------

[](#features)

- Generates an `llms.txt` file in the root of your website in Markdown format
- Generates an XML sitemap at `sitemap.xml` using the same page filtering as LLMs.txt
- Provides dedicated routes to access both LLMs information and sitemap
- Creates proper Markdown links for pages with trailing slashes (configurable)
- Strips HTML tags from descriptions and metadata for clean output
- Configurable exclusion of pages and templates
- Configurable inclusion of pages that override exclusions
- Groups pages by parent page name or template type with section headings (e.g. `## Blog`, `## Products`)
- Automatic cache clearing when content changes
- Supports configuration via your site's main config.php file
- Panel integration for easy configuration through the Kirby admin interface

Installation
------------

[](#installation)

### Manual Installation

[](#manual-installation)

1. Download or clone this repository
2. Place the folder `kirby-llms` in your `site/plugins` directory
3. Rename the folder to `kirby-llms` if needed

### Composer Installation

[](#composer-installation)

```
composer require kozmozio/kirby-llms
```

Configuration
-------------

[](#configuration)

### Via Config File

[](#via-config-file)

You can configure the plugin by adding options to your `config.php` file:

```
return [
  'kozmozio.llms' => [
    'enabled' => true,
    'cache' => true,
    'cache.duration' => 60, // minutes
    'add_trailing_slash' => true, // Whether to add trailing slashes to URLs
    'group_by' => 'parent', // Group pages by: 'parent', 'template', or 'none'
    'sitemap_enabled' => true, // Enable XML sitemap generation
    'exclude' => [
      'templates' => ['error', 'faq', 'faqs', 'faqpage', 'faq-page'],
      'pages' => ['faqs', 'private-page', 'another-page']
    ],
    'include' => [
      'pages' => ['important-page', 'always-visible'] // Pages to always include despite exclusions
    ]
  ]
];
```

### Via Kirby Panel

[](#via-kirby-panel)

The plugin also provides a panel interface for configuring the settings. To enable this, you need to add the LLMs tab to your site blueprint.

1. Add the LLMs tab to your `site.yml` blueprint:

```
# site.yml
title: Site
unlisted: true

tabs:
  # Your existing tabs...

  # LLMs settings tab
  llms: kozmoz/llms

```

This will add a new "LLMs" tab to your site settings in the panel, where you can configure:

- Enable/disable the LLMs.txt generation
- Enable/disable the XML sitemap generation
- Enable/disable caching
- Set cache duration
- Enable/disable adding trailing slashes to URLs
- Choose page grouping strategy (by parent, by template, or no grouping)
- Exclude templates and pages
- Include pages that should always be visible despite exclusions

### Blueprint Structure

[](#blueprint-structure)

The plugin uses the following blueprint structure:

```
blueprints/
├── kozmoz/
│   └── llms-settings.yml  # The main settings section
├── tabs/
│   └── llms.yml           # The tab that extends the settings section

```

You can customize these blueprints by copying them to your site's blueprint directory and modifying them as needed:

```
site/
└── blueprints/
    ├── sections/
    │   └── llms-settings.yml  # Your customized settings
    └── tabs/
        └── llms.yml           # Your customized tab

```

### Configuration Options

[](#configuration-options)

OptionTypeDefaultDescription`enabled`boolean`true`Enable or disable serving llms.txt`sitemap_enabled`boolean`true`Enable or disable XML sitemap generation`cache`boolean`false`Enable or disable caching`cache.duration`integer`60`Cache duration in minutes`add_trailing_slash`boolean`true`Whether to add trailing slashes to URLs in the output`group_by`string`'parent'`Group pages by: `'parent'` (parent page name), `'template'` (template type), or `'none'` (flat list)`exclude.templates`array`['error']`Templates to exclude from the output`exclude.pages`array`[]`Pages to exclude from the output`include.pages`array`[]`Pages to always include despite exclusions### Excluding Pages

[](#excluding-pages)

You can exclude specific pages from the llms.txt output by adding their slugs to the `exclude.pages` array in your configuration. The plugin performs matching on:

- Exact page ID or URI match
- Pages with the same name in different locations (e.g., if you exclude 'inan-olcer', both 'inan-olcer' and 'team/inan-olcer' will be excluded)
- Child pages of excluded parents
- Pages with URIs containing specific strings (e.g., if you exclude 'faq', all pages with 'faq' in their URI will be excluded)

For example:

```
'exclude' => [
  'pages' => ['about', 'blog/private-post', 'team-member', 'faqs']
]
```

### Including Pages (Override Exclusions)

[](#including-pages-override-exclusions)

You can specify pages that should always be included in the output, even if they would normally be excluded by template or page exclusion rules. This is useful when you want to exclude a template globally but include specific pages that use that template.

The `include.pages` option overrides all exclusion rules and uses the same matching logic as exclusions:

- Exact page ID or URI match
- Child pages of included parents
- Pages with URIs containing the included string

For example:

```
'include' => [
  'pages' => ['faqs', 'important-faq', 'contact']
],
'exclude' => [
  'templates' => ['faqs', 'contact'], // These templates are excluded
  'pages' => ['private-page']
]
```

In this example:

- All `faqs` and `contact` template pages are excluded by default
- But pages under `faqs/` (like `faqs/question-one`) will be included because `faqs` is in the include list
- The `contact` page will be included despite using the excluded `contact` template
- Any page with `important-faq` in its URI will be included

**Include rules always take precedence over exclude rules.**

Usage
-----

[](#usage)

Once installed, the plugin automatically sets up two routes:

- `yourdomain.com/llms.txt` - Generates the LLMs information in Markdown format
- `yourdomain.com/sitemap.xml` - Generates an XML sitemap using the same page filtering

The LLMs content will be in Markdown format with proper Markdown links for pages and their descriptions. The sitemap will be in standard XML format following the sitemap protocol. All HTML tags are automatically stripped from descriptions and metadata to ensure clean, plain text output.

### Automatic Cache Clearing

[](#automatic-cache-clearing)

The plugin automatically clears its cache when:

- Pages are created, updated, or deleted
- Page properties change (status, slug, title, template)
- Site information is updated

This ensures that both the `llms.txt` content and `sitemap.xml` are always up-to-date with your website's content.

### Example Output

[](#example-output)

#### LLMs.txt Output

[](#llmstxt-output)

With default `group_by: parent`:

```
# Your Website Title

> Your Website Title is your website description

Generated on: 2023-06-15 12:34:56

## Blog

- [Article One](https://example.com/blog/article-one/) - Our first post
- [Article Two](https://example.com/blog/article-two/) - Our second post

## Products

- [Widget A](https://example.com/products/widget-a/) - Our flagship widget
- [Widget B](https://example.com/products/widget-b/) - A compact alternative

## Pages

- [Home](https://example.com/) - Welcome to our website
- [About Us](https://example.com/about/) - Learn more about our company
- [Contact](https://example.com/contact/) - Get in touch with us
```

With `group_by: none` (flat list):

```
# Your Website Title

> Your Website Title is your website description

Generated on: 2023-06-15 12:34:56

## Docs

- [Home](https://example.com/) - Welcome to our website
- [About Us](https://example.com/about/) - Learn more about our company and our mission
- [Products](https://example.com/products/) - Explore our range of products
- [Blog](https://example.com/blog/) - Read our latest articles
- [Contact](https://example.com/contact/) - Get in touch with us
```

#### Sitemap.xml Output

[](#sitemapxml-output)

```

    https://example.com/
    2023-06-15T12:34:56+00:00
    daily
    1.0

    https://example.com/about/
    2023-06-10T08:20:15+00:00
    weekly
    0.8

    https://example.com/products/
    2023-06-12T14:45:30+00:00
    weekly
    0.8

```

Static Site Generation
----------------------

[](#static-site-generation)

If you're using a static site generator with Kirby, make sure to include both routes in your static routes:

```
array_push($staticRoutes, [
  'path' => 'llms.txt',
  'route' => 'llms.txt'
]);

array_push($staticRoutes, [
  'path' => 'sitemap.xml',
  'route' => 'sitemap.xml'
]);
```

Development Status
------------------

[](#development-status)

### Phase 1: Basic Structure and Setup ✓

[](#phase-1-basic-structure-and-setup-)

1. Create plugin folder structure ✓
2. Set up plugin initialization ✓
3. Register the route for `llms.txt` ✓
4. Implement basic configuration options ✓

### Phase 2: Core Functionality ✓

[](#phase-2-core-functionality-)

1. Develop the content generator for `llms.txt` ✓
2. Implement page collection and filtering ✓
3. Create the response formatter ✓
4. Add caching mechanism ✓

### Phase 3: Advanced Features ✓

[](#phase-3-advanced-features-)

1. Add customization options for content exclusion ✓
2. Implement metadata extraction ✓
3. Add automatic cache clearing when content changes ✓
4. Strip HTML tags from descriptions and metadata ✓
5. Ensure URLs have trailing slashes ✓

### Phase 4: Testing and Documentation ✓

[](#phase-4-testing-and-documentation-)

1. Test with different Kirby setups ✓
2. Create comprehensive documentation ✓
3. Add examples and use cases ✓
4. Prepare for release ✓

Author
------

[](#author)

[Inan Olcer Kozmoz](https://kozmoz.io)

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance77

Regular maintenance activity

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~89 days

Total

5

Last Release

125d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b1f4255f74d7cd6f6edd97e28c66d44640342bf0b5f935957c4e962fcf586b5?d=identicon)[kozmoz](/maintainers/kozmoz)

---

Top Contributors

[![inanolcer](https://avatars.githubusercontent.com/u/12511812?v=4)](https://github.com/inanolcer "inanolcer (20 commits)")

---

Tags

kirby4kirby5kirbycmsllmsllmstxtrobotsrobotstxt

### Embed Badge

![Health badge](/badges/kozmozio-kirby-llms/health.svg)

```
[![Health](https://phpackages.com/badges/kozmozio-kirby-llms/health.svg)](https://phpackages.com/packages/kozmozio-kirby-llms)
```

###  Alternatives

[getkirby/cms

The Kirby core

1.5k584.8k474](/packages/getkirby-cms)[medienbaecker/kirby-modules

Easily add modules to your pages

895.5k1](/packages/medienbaecker-kirby-modules)[distantnative/retour-for-kirby

Manage redirects and track 404s right from the Kirby CMS Panel

14698.5k1](/packages/distantnative-retour-for-kirby)[arnoson/kirby-vite

Vite helper for Kirby CMS

9765.1k3](/packages/arnoson-kirby-vite)[bnomei/kirby3-dotenv

Kirby Plugin for environment variables from .env

4149.6k2](/packages/bnomei-kirby3-dotenv)[medienbaecker/kirby-alter

242.1k](/packages/medienbaecker-kirby-alter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
