Custom Software

Lostedges LLMS: WordPress llms.txt

A WordPress plugin that generates and maintains an llms.txt file: a curated Markdown map of the pages you want language models to read.

Lost Edges wordpress php llms-txt content
Lostedges LLMS: WordPress llms.txt
One Markdown file at the site root, built from the pages you choose and the notes you attach to them.
Status: Active

Overview

Lostedges LLMS is a WordPress plugin that writes and keeps an llms.txt file. The file is Markdown. It gives language models and tools a curated view of the site: the pages you choose, each with a short human-readable note.

A sitemap lists everything. llms.txt lists what you want a model to read, with a sentence or two about each link.

The current release is 1.2.1. It runs on WordPress 6.0+ and PHP 7.4+.

What the file looks like

The generator follows the llmstxt.org shape:

  • A title from the site name
  • A short blockquote from the site description, when one is set
  • A section per post type, using that type’s plural label
  • One list item per published item: - [Title](url): notes

Notes are built from the fields you mark for inclusion, joined as Label: value. A description can fall back to the excerpt, or to a short strip of the content, when that option is on. Type and price are omitted when they are empty. A dropdown value that is no longer in the allowed list is omitted too, so a renamed choice does not linger in the file.

Per-post notes

Editors get a meta box on the post types you select. Fields are configurable:

  • Text and textarea, written as plain text or as Markdown
  • A dropdown, including a shared “type” list
  • A USD price

Plain text is the default. HTML is stripped, and the note is collapsed to one line. Markdown keeps line breaks and the punctuation you typed. Select values and prices always use the plain path.

How updates land on disk

Settings live under Settings → Lostedges LLMS. You pick public post types, the type list, and the field definitions.

When auto-update is on, a save or delete schedules one delayed rebuild. Further edits in that window clear the pending job and push it back, so a burst of changes becomes a single write. The delay is configurable between 5 and 300 seconds. The scheduled job uses WordPress cron. On a quiet site, a real system cron hitting wp-cron.php keeps the timing predictable. You can also regenerate by hand.

The writer prefers llms.txt in the WordPress root, which is the URL people expect: https://example.com/llms.txt. If that directory is not writable, the file goes under wp-content/uploads/ and the admin screen says so.

Writes go to a temp file and then rename into place. Deletes, from the admin tool or from uninstall, only touch those two known paths.

Admin tools

  • Preview shows the Markdown once, without posting the whole document back through the settings form
  • Regenerate & save file runs the generator and the writer
  • Delete llms.txt removes the file after a confirm step, so a bad generation can be pulled without deactivating the plugin

Lifecycle

Deactivating the plugin clears the scheduled rebuild and leaves llms.txt on disk, so turning it off is reversible. Uninstall removes the settings, the scheduled job, and the file from both managed locations.

How it is built

The plugin is plain PHP. A single bootstrap file loads small classes for settings, post meta, the Markdown generator, the file writer, the scheduler, and the admin screen. There is no Composer autoload, so a copy into wp-content/plugins/ is enough for shared hosting.

Each rebuild is one query of published posts, with post meta loaded in a batch. The default cap is 500 posts. A filter can raise that cap, change the query, or rewrite the Markdown before it is saved.

Security

Settings and tools require the manage_options capability. Meta box saves, preview, regenerate, and delete use nonces. Autosaves and revisions do not write the plugin’s meta. Each field type has its own sanitizer, and dropdown values are checked against the current list. Admin output is escaped.

Current status

Active. Install the plugin, choose the post types and fields, and regenerate once. After that, publishing can keep llms.txt current on its own.

  • A curated llms.txt. Published posts and pages become a short Markdown list: a title, a canonical URL, and a note. Fewer URLs than a sitemap, and enough context to be useful.
  • Notes you control. Each post can carry a description, a type, a price, and any other fields you define. Empty or outdated dropdown values are left out of the file.
  • Updates without a manual export. Saves can regenerate the file on a short delay, so a burst of edits becomes one write. Preview, regenerate, and delete stay available in wp-admin.
← Back to Projects July 20, 2026