Directory / plugin
LLM Friendly
v0.4.1 · by Pavel Sherer
Publish llms.txt, structured catalogs and Markdown for public WordPress content, with optional integrations for unavailable URLs.
About this plugin
LLM Friendly gives your WordPress site predictable, machine-readable entry points for AI assistants, search/indexing bots, internal knowledge tools, and readers who prefer plain text.
The plugin works without a specific theme, archive status or redirect plugin. Independent integrations can supply replacements for unavailable Markdown URLs: the plugin validates the destination and returns a permanent redirect or a generic 410 response. It does not include a redirect manager or store redirect rules.
Instead of asking crawlers to infer your site structure from HTML alone, the plugin publishes a focused /llms.txt index and optional Markdown versions of selected public content. You stay in control of what is exposed, how dense the index should be, which endpoints should be noindexed, and which posts or pages should be excluded.
What the plugin creates
/llms.txt
The generated llms.txt file includes the site title and description, main links, sitemap and RSS references, an Essential section for important pages or curated resources, and recent items grouped by selected post type. Items can link to Markdown exports when Markdown is enabled, or to canonical HTML URLs when it is not.
- Markdown exports
For selected public, publicly queryable post types, the plugin exposes .md endpoints under:
/{base}/{post_type}/{path}.md
Each Markdown export includes a stable, plugin-defined JSON metadata block with title, URL, published and modified dates, language, description, author, and publisher, followed by a Markdown conversion of the post content. Frontend pages advertise /llms.txt with a describedby link, while supported singular views also receive alternate Markdown links.
An optional content-negotiation mode can return the same representation from canonical singular URLs when a client explicitly sends Accept: text/markdown. The mode is disabled by default and uses Vary: Accept, so it should only be enabled when every page cache, reverse proxy, and CDN respects that header.
Why site owners use it
- Give AI tools a concise map of your most useful public content.
- Offer Markdown versions of posts, pages, and safe public custom post types without changing the canonical HTML experience.
- Keep Markdown endpoints out of search results by default with separate noindex controls for
/llms.txtand.mdexports. - Add short AI-facing descriptions from a per-post field, SEO meta description, excerpt, or generated content summary.
- Exclude individual items from both
/llms.txtand Markdown exports without changing their WordPress visibility. - Preview generated llms.txt content before relying on the public endpoint.
- Review practical AI crawler policy guidance for OAI-SearchBot, GPTBot, ChatGPT-User, Googlebot/Search AI features, and Google-Extended.
Key features
Version 0.3.0 adds the following optional mechanics. Both new modes default to the previous behavior for new and existing installations.
- Independent index structure (legacy/structured) and content processing (legacy/enhanced) controls, with an unsaved comparison before applying changes.
- A short structured root map, up to 100 ordered pinned selections, detailed content-type/topic indexes and bounded cursor pagination under /{base}/catalog/.
- Paragraph-based enhanced summaries, improved lists/tables/media/code conversion, published reusable-block dependency tracking and manual override review status.
- Administrator-only HTTP availability checks and a resumable coverage scan, with conversion warnings and a clear distinction between exportable content and inclusion in the short map.
-
Switching back retains new selections and manual content. Existing export URLs, JSON metadata and Essential links remain supported.
-
llms.txt endpoint with cached generation, ETag/Last-Modified support, v2-compatible linked lists, main links, sitemap/RSS references, an Essential section, selected post-type sections, optional item descriptions, and an optional custom Markdown notes block.
- Markdown exports for selected public, publicly queryable post types with Gutenberg/HTML-to-Markdown conversion, plugin-defined JSON metadata, canonical/describedby Link headers, alternate Markdown discovery links, and transient-based body caching.
- Optional
Accept: text/markdowncontent negotiation on canonical singular URLs withVary: Accept; disabled by default for cache safety. - Overview dashboard with endpoint status, cache status, noindex status, sitemap URL, and quick copy buttons for
/llms.txtand the Markdown URL pattern. - Configurable Markdown base path, for example
/llm/post/example.md, with post type controls for posts, pages, and safe public custom post types. - Per-post-type exclusion picker with live title search, selected-item lists, clear buttons, and server-side validation.
- Separate noindex header controls for
/llms.txtand Markdown exports. - Auto or manual llms.txt regeneration; manual rebuilds are available from the Maintenance panel.
- Live llms.txt preview that uses saved settings and does not update the public cache.
- Optional excerpts/descriptions in llms.txt. Description priority is: per-post LLM description, SEO meta description, explicit excerpt, then a generated content summary.
- Per-post “Markdown override (LLM Friendly)” metabox for custom Markdown or Gutenberg block markup, plus a one-line llms.txt description field.
- Optional site title, site description, and author overrides for generated metadata.
- Same-site sitemap URL validation. External sitemap URLs are rejected unless a developer explicitly allows them with a filter.
- AI crawler diagnostics with policy examples and documentation links for OAI-SearchBot, GPTBot, ChatGPT-User, Googlebot/Search AI features, and Google-Extended. The plugin does not edit robots.txt automatically.
- Hardened public export boundaries: attachments, drafts, private content, password-protected posts, and non-public/non-queryable post types are excluded by default.
- KSES sanitization for users without
unfiltered_html, length caps for custom Markdown fields, and developer filters for edge cases.
Requirements
- WordPress 6.0+
- PHP 7.4+
If requirements are not met, the plugin displays an admin notice and does not run.
Development
Run composer run lint to syntax-check the plugin PHP files.
Run composer run test to execute lightweight regression tests for Markdown conversion, llms.txt format, headers, and sanitization.
See TESTING.md for WordPress integration scenarios.
Developer Notes
llmf_resolve_unavailable_markdownacceptsnull,array( 'status' => 410 ), orarray( 'status' => 301, 'target_post_id' => 123 )for unavailable Markdown URLs. Available exports bypass it. Destinations are validated anonymously and must remain public, password-free and on the same origin; eligible Markdown is preferred over HTML. Providers own their rules and lifecycle. Historical URLs must reach WordPress through the web server.llmf_can_export_postcan deny a post formarkdown,llms, orllms_searchcontexts.llmf_exportable_post_typecan explicitly opt in a public edge-case post type that is safe to expose even though WordPress marks it as not publicly queryable.llmf_markdown_override_max_lengthchanges the per-post Markdown override length cap. Default: 200000 characters; absolute maximum: 500000.llmf_llms_description_max_lengthchanges the per-post llms.txt description length cap. Default: 500 characters; absolute maximum: 2000.llmf_markdown_metadatafilters the JSON metadata array emitted at the top of each Markdown export.llmf_markdown_cache_ttlchanges the transient TTL for cached Markdown export bodies. Default: 3600 seconds.llmf_llms_essential_linksfilters curated link items emitted in the llms.txt Essential section.llmf_debug_headers_enabledenables diagnostic X-LLMF-* headers for llms.txt responses when returningtrue.llmf_max_excluded_posts_per_typechanges the per-post-type exclusion cap. Default: 500; absolute maximum: 5000.llmf_allow_external_sitemap_urlallows an external sitemap URL when returningtrue.- Users without
unfiltered_htmlhave custom Markdown sanitized with WordPress KSES. Heading markers are removed from the custom llms.txt notes block so user-provided notes cannot break the required llms.txt section order.