Llms Txt

Generates llms.txt and llms-full.txt files for LLMs from your Payload collections.

Community 0 MIT v0.2.0

Installation

pnpm add payload-plugin-llms-txt

About

This plugin produces llms.txt and llms-full.txt files following the llmstxt.org convention, so AI assistants and crawlers can discover and read your site content. It reads directly from your Payload collections, so the generated files stay in sync with whatever you publish in the CMS rather than a separate hand-maintained manifest. You configure it per collection. For each collection you pick a title field, an optional description field (with ordered fallback paths, so a dedicated LLM-facing description can fall back to an existing SEO meta description), a function that builds each document's public URL, and an optional richText field to inline as Markdown in llms-full.txt. Documents are fetched with `payload.find`, filtered to `_status: 'published'` by default, and capped at a configurable per-collection limit (1000 by default). The plugin registers GET endpoints for `/llms.txt` and `/llms-full.txt` under Payload's API route. Because the llms.txt convention expects the files at the site root rather than under `/api`, it also exports Next.js route handlers from `payload-plugin-llms-txt/next` that you drop into `app/llms.txt/route.ts` and `app/llms-full.txt/route.ts`. Next is an optional peer dependency for that reason. For the full-text variant, each document's richText content is converted to Markdown via `@payloadcms/richtext-lexical`, which is a required peer dependency. Block-based page layouts with a `layout` array of blocks are not flattened to Markdown in this version, so those collections appear in the index only. An optional admin settings Global adds an enable toggle and an intro text override so editors can control the files without touching code.

Package info

Package name
payload-plugin-llms-txt
Latest version
0.2.0
Unpacked size
89 kB
License
MIT
Last publish
Aug 1, 2026

Similar plugins

More in SEO