Generates an llms.txt index and an optional llms-full.txt with full Markdown content from selected Payload collections. It is registered as a plugin in the Payload config, with an optional admin-editable settings Global. Next.js route handlers serve the files from the site root, and Payload API endpoints are registered for other setups. Requires Payload 3.
Payload CMS plugin that generates llms.txt and llms-full.txt from your collections
Installation
npm i payload-plugin-llms-txt2
Stars
0
Forks
0
Open Issues
4 months ago
Last Updated
185
Weekly Downloads
v0.2.0
npm Version
88.5 KB
Unpacked Size
0
Dependencies
2+1 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 2 |
| Dec 5, 2026 | 2 |
| Dec 4, 2026 | 2 |
| Dec 3, 2026 | 2 |
| Dec 2, 2026 | 2 |
| Dec 1, 2026 | 2 |
| Nov 30, 2026 | 2 |
| Nov 29, 2026 | 2 |
| Nov 28, 2026 | 2 |
| Nov 27, 2026 | 2 |
| Nov 26, 2026 | 2 |
| Nov 25, 2026 | 2 |
| Nov 24, 2026 | 2 |
| Nov 23, 2026 | 2 |
| Nov 22, 2026 | 2 |
| Nov 21, 2026 | 2 |
| Nov 20, 2026 | 2 |
| Nov 19, 2026 | 2 |
| Nov 18, 2026 | 2 |
| Nov 17, 2026 | 2 |
| Nov 16, 2026 | 2 |
| Nov 15, 2026 | 2 |
| Nov 14, 2026 | 2 |
| Nov 13, 2026 | 2 |
| Nov 12, 2026 | 2 |
| Nov 11, 2026 | 2 |
| Nov 10, 2026 | 2 |
| Nov 9, 2026 | 2 |
| Nov 8, 2026 | 2 |
| Nov 7, 2026 | 2 |
| Nov 6, 2026 | 2 |
| Nov 5, 2026 | 2 |
| Nov 4, 2026 | 2 |
| Nov 3, 2026 | 2 |
| Nov 2, 2026 | 2 |
| Nov 1, 2026 | 2 |
| Oct 31, 2026 | 2 |
| Oct 30, 2026 | 2 |
| Oct 29, 2026 | 2 |
| Oct 28, 2026 | 2 |
| Oct 27, 2026 | 2 |
| Oct 26, 2026 | 2 |
| Oct 25, 2026 | 2 |
| Oct 24, 2026 | 2 |
| Oct 23, 2026 | 2 |
| Oct 22, 2026 | 2 |
| Oct 21, 2026 | 2 |
| Oct 20, 2026 | 2 |
| Oct 19, 2026 | 2 |
| Oct 18, 2026 | 2 |
| Oct 17, 2026 | 2 |
| Oct 16, 2026 | 2 |
| Oct 15, 2026 | 2 |
| Oct 14, 2026 | 2 |
| Oct 13, 2026 | 2 |
| Oct 12, 2026 | 2 |
| Oct 11, 2026 | 2 |
| Oct 10, 2026 | 2 |
| Oct 9, 2026 | 2 |
| Oct 8, 2026 | 2 |
| Oct 7, 2026 | 2 |
| Oct 6, 2026 | 2 |
| Oct 5, 2026 | 2 |
| Oct 4, 2026 | 2 |
| Oct 3, 2026 | 2 |
| Oct 2, 2026 | 2 |
| Oct 1, 2026 | 2 |
| Sep 30, 2026 | 1 |
| Sep 29, 2026 | 1 |
| Sep 28, 2026 | 1 |
| Sep 27, 2026 | 1 |
| Sep 26, 2026 | 1 |
| Sep 25, 2026 | 1 |
| Sep 24, 2026 | 1 |
| Sep 23, 2026 | 1 |
| Sep 22, 2026 | 1 |
| Sep 21, 2026 | 1 |
| Sep 20, 2026 | 1 |
| Sep 19, 2026 | 1 |
| Sep 18, 2026 | 1 |
| Sep 17, 2026 | 1 |
| Sep 16, 2026 | 1 |
| Sep 15, 2026 | 1 |
| Sep 14, 2026 | 1 |
| Sep 13, 2026 | 1 |
| Sep 12, 2026 | 1 |
| Sep 11, 2026 | 1 |
| Sep 10, 2026 | 1 |
| Sep 9, 2026 | 1 |
| Sep 8, 2026 | 1 |
| Sep 7, 2026 | 1 |
178+165 since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 178 |
| Dec 5, 2026 | 148 |
| Dec 4, 2026 | 128 |
| Dec 3, 2026 | 103 |
| Dec 2, 2026 | 97 |
| Dec 1, 2026 | 99 |
| Nov 30, 2026 | 89 |
| Nov 29, 2026 | 107 |
| Nov 28, 2026 | 106 |
| Nov 27, 2026 | 158 |
| Nov 26, 2026 | 157 |
| Nov 25, 2026 | 162 |
| Nov 24, 2026 | 159 |
| Nov 23, 2026 | 153 |
| Nov 22, 2026 | 154 |
| Nov 21, 2026 | 164 |
| Nov 20, 2026 | 118 |
| Nov 19, 2026 | 104 |
| Nov 18, 2026 | 93 |
| Nov 17, 2026 | 92 |
| Nov 16, 2026 | 100 |
| Nov 15, 2026 | 93 |
| Nov 14, 2026 | 71 |
| Nov 13, 2026 | 76 |
| Nov 12, 2026 | 79 |
| Nov 11, 2026 | 83 |
| Nov 10, 2026 | 104 |
| Nov 9, 2026 | 121 |
| Nov 8, 2026 | 102 |
| Nov 7, 2026 | 118 |
| Nov 6, 2026 | 107 |
| Nov 5, 2026 | 106 |
| Nov 4, 2026 | 95 |
| Nov 3, 2026 | 98 |
| Nov 2, 2026 | 98 |
| Nov 1, 2026 | 97 |
| Oct 31, 2026 | 88 |
| Oct 30, 2026 | 97 |
| Oct 29, 2026 | 88 |
| Oct 28, 2026 | 81 |
| Oct 27, 2026 | 61 |
| Oct 26, 2026 | 32 |
| Oct 25, 2026 | 30 |
| Oct 24, 2026 | 25 |
| Oct 23, 2026 | 15 |
| Oct 22, 2026 | 18 |
| Oct 21, 2026 | 31 |
| Oct 20, 2026 | 39 |
| Oct 19, 2026 | 39 |
| Oct 18, 2026 | 38 |
| Oct 17, 2026 | 31 |
| Oct 16, 2026 | 32 |
| Oct 15, 2026 | 31 |
| Oct 14, 2026 | 18 |
| Oct 13, 2026 | 7 |
| Oct 12, 2026 | 6 |
| Oct 11, 2026 | 11 |
| Oct 10, 2026 | 10 |
| Oct 9, 2026 | 14 |
| Oct 8, 2026 | 13 |
| Oct 7, 2026 | 14 |
| Oct 6, 2026 | 14 |
| Oct 5, 2026 | 15 |
| Oct 4, 2026 | 12 |
| Oct 3, 2026 | 12 |
| Oct 2, 2026 | 11 |
| Oct 1, 2026 | 11 |
| Sep 30, 2026 | 10 |
| Sep 29, 2026 | 9 |
| Sep 28, 2026 | 9 |
| Sep 27, 2026 | 8 |
| Sep 26, 2026 | 12 |
| Sep 25, 2026 | 10 |
| Sep 24, 2026 | 9 |
| Sep 23, 2026 | 13 |
| Sep 22, 2026 | 15 |
| Sep 21, 2026 | 14 |
| Sep 20, 2026 | 19 |
| Sep 19, 2026 | 16 |
| Sep 18, 2026 | 25 |
| Sep 17, 2026 | 27 |
| Sep 16, 2026 | 26 |
| Sep 15, 2026 | 24 |
| Sep 14, 2026 | 26 |
| Sep 13, 2026 | 21 |
| Sep 12, 2026 | 22 |
| Sep 11, 2026 | 11 |
| Sep 10, 2026 | 12 |
| Sep 9, 2026 | 11 |
| Sep 8, 2026 | 11 |
| Sep 7, 2026 | 13 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1318920130-root)<a href="https://payloaddirectory.dev/plugins/1318920130-root"><img src="https://payloaddirectory.dev/badge/1318920130-root.svg" alt="Payload Directory"></a>README
Generate llms.txt (and optionally llms-full.txt) for a Payload CMS site, straight from your collections.
npm install payload-plugin-llms-txt
Register the plugin in payload.config.ts to (optionally) add an admin-editable settings Global:
import { llmsTxtPlugin } from 'payload-plugin-llms-txt'
export default buildConfig({
plugins: [
llmsTxtPlugin({
siteName: 'My Site',
siteDescription: 'A site about things.',
siteURL: 'https://example.com',
enableFullText: true,
addSettingsGlobal: true, // adds an "LLMs.txt Settings" admin global
collections: [
{
slug: 'posts',
// Tries `llmsDescription` first, falls back to the SEO field when empty —
// useful when you're rolling out a dedicated LLM-facing description field
// without having to backfill every existing document immediately.
descriptionField: ['llmsDescription', 'meta.description'],
contentField: 'content', // richText field, converted to Markdown for llms-full.txt
urlPath: (doc) => `/posts/${doc.slug}`,
},
{
slug: 'pages',
urlPath: (doc) => `/${doc.slug}`,
// no contentField for block-based layouts — the page still appears in the
// index, just without full-text content in llms-full.txt
},
],
}),
],
})
llms.txt should be served from your site's root, not under /api, so in Next.js apps add route handlers using the /next export instead of relying on the Payload-native endpoint:
// app/llms.txt/route.ts
import config from '@payload-config'
import { createLlmsTxtRouteHandler } from 'payload-plugin-llms-txt/next'
export const GET = createLlmsTxtRouteHandler(config, {
/* same options object as above */
})
// app/llms-full.txt/route.ts
import config from '@payload-config'
import { createLlmsFullTxtRouteHandler } from 'payload-plugin-llms-txt/next'
export const GET = createLlmsFullTxtRouteHandler(config, {
/* same options object as above */
})
For non-Next.js consumers, the plugin also registers GET /llms.txt and GET /llms-full.txt under Payload's configured API route (e.g. /api/llms.txt) automatically.
| Option | Type | Default | Description |
|---|---|---|---|
collections | LlmsTxtCollectionConfig[] | — | Which collections to include, and how to read/link each document. |
siteName | string | — | Heading at the top of the generated file. |
siteDescription | string | — | Intro blurb, unless overridden by the settings Global. |
siteURL | string | — | Base URL used to build absolute links. |
enableFullText | boolean | false | Also generate llms-full.txt with full Markdown content inline. |
addSettingsGlobal | boolean | string | false | Adds an admin-editable Global (enable toggle + intro override). Pass a string to customize its slug. |
limitPerCollection | number | 1000 | Max documents fetched per collection. |
LlmsTxtCollectionConfig| Option | Type | Default | Description |
|---|---|---|---|
slug | string | — | Collection slug. |
titleField | string | 'title' | Field used as the entry title. |
descriptionField | string | string[] | — | Dot-path field used as the index description (e.g. 'meta.description'), or an ordered array of fallback fields — the first one with a non-empty value wins (e.g. ['llmsDescription', 'meta.description']). |
contentField | string | — | richText field name to convert to Markdown for llms-full.txt. Omit for block-based layouts (e.g. Payload's block-based Pages) — those entries stay index-only. |
urlPath | (doc) => string | — | Builds the document's public path. |
publishedOnly | boolean | true | Filter to _status: 'published'. Set false for collections without drafts/versions. |
label | string | Capitalized slug | Section heading in the index. |
layout array of blocks) aren't flattened to Markdown in v1 — configure contentField only for collections with a single richText field.llms-full.txt uses editorConfigFactory.default() for Markdown conversion; highly custom per-field Lexical features may not fully round-trip.MIT
Topics
payload seo analyzer
Offline on-page SEO analysis, admin dashboard, sitemaps and JSON-LD for Payload 3 and Next.js sites
72880/wk17v3
seo
SEO fields, settings global and automatic redirects for Payload, with Next.js metadata, sitemap and robots helpers
75303/wk3v3
payload plugin structured data
JSON-LD structured data for Payload pages, editable from admin settings and per-document overrides
6943/wk1v3
sitemap
Chunked, lazily cached XML sitemaps with hook-driven invalidation and robots.txt helpers
62156/wk16v3
payload plugin seo jsonld
JSON-LD builders for Payload v3 shops: Product, BreadcrumbList, ItemList, WebSite and Organization
617/wk1v3
advanced seo plugin
SEO meta group, global defaults, hreflang alternates, OG image generation and JSON-LD builders for Payload collections
09/wk3v3