
內容簡介
LLM Friendly 外掛為您的 WordPress 網站提供可預測的機器可讀入口,適用於 AI 助手、搜尋爬蟲、內部知識工具及喜好純文字的讀者。透過生成的 /llms.txt 索引,您可以控制公開內容的曝光及索引密度。
【主要功能】
• 生成 /llms.txt 索引,包含網站標題、描述及主要連結
• 提供 Markdown 輸出,適用於選定的公共文章類型
• 支援自定義的 noindex 控制,避免搜尋結果顯示
• 提供即時的 llms.txt 預覽功能
• 可選擇性地排除特定項目不顯示於索引中
外掛標籤
開發者團隊
原文外掛簡介
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.
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.txt and .md exports.
Add short AI-facing descriptions from a per-post field, SEO meta description, excerpt, or generated content summary.
Exclude individual items from both /llms.txt and 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
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/markdown content negotiation on canonical singular URLs with Vary: Accept; disabled by default for cache safety.
Overview dashboard with endpoint status, cache status, noindex status, sitemap URL, and quick copy buttons for /llms.txt and 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.txt and 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_can_export_post can deny a post for markdown, llms, or llms_search contexts.
llmf_exportable_post_type can 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_length changes the per-post Markdown override length cap. Default: 200000 characters; absolute maximum: 500000.
llmf_llms_description_max_length changes the per-post llms.txt description length cap. Default: 500 characters; absolute maximum: 2000.
llmf_markdown_metadata filters the JSON metadata array emitted at the top of each Markdown export.
llmf_markdown_cache_ttl changes the transient TTL for cached Markdown export bodies. Default: 3600 seconds.
llmf_llms_essential_links filters curated link items emitted in the llms.txt Essential section.
llmf_debug_headers_enabled enables diagnostic X-LLMF-* headers for llms.txt responses when returning true.
llmf_max_excluded_posts_per_type changes the per-post-type exclusion cap. Default: 500; absolute maximum: 5000.
llmf_allow_external_sitemap_url allows an external sitemap URL when returning true.
Users without unfiltered_html have 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.
