| Filter | Arguments | Use |
|---|---|---|
lh_ai_legibility_init_plugin | bool $init | Return false to switch the plugin off without deactivating it. |
lh_ai_legibility_markdown_enabled | bool $enabled, WP_Post $post | Return false to stop serving Markdown for a post, or for a whole post type. Also keeps the post out of llms-full.txt and out of archive pages served as Markdown. |
lh_ai_legibility_markdown_output | string $markdown, WP_Post $post | Change a post’s Markdown, without its front matter, both in a response to an Accept: text/markdown request and where the post appears in llms-full.txt. |
lh_ai_legibility_archive_markdown_enabled | bool $enabled, WP_Query $query | Return false to stop serving an archive page, or all of them, as Markdown. |
lh_ai_legibility_archive_item_summary | string $summary, WP_Post $post | The one-line summary after a post’s link on an archive page served as Markdown. By default its excerpt, only when one was written; empty for none. |
lh_ai_legibility_llms_txt_output | string $output | Change the final /llms.txt output. |
lh_ai_legibility_llms_full_output | string $output | Change the final /llms-full.txt output. |
lh_ai_legibility_return_max_http_checks | int $max | Most links the llms.txt abilities request over HTTP in one call, when asked to check every link. Default 25. |
Each identifier is returned by a static method on LH_AI_Legibility_Llms_Txt and can be changed with the filter of the same name. Change them only before any llms.txt document exists, since existing documents and the stored option use the old values.
| Filter | Default | What it names |
|---|---|---|
lh_ai_legibility_return_post_type | llms_txt_document | The llms.txt document post type |
lh_ai_legibility_return_index_query_var | lh_llms_txt | The query variable behind /llms.txt |
lh_ai_legibility_return_full_query_var | lh_llms_full_txt | The query variable behind /llms-full.txt |
lh_ai_legibility_return_document_option_name | lh_ai_legibility_document_id | The option holding the site’s document ID |
The section block is lh-ai-legibility/section (named llms-txt/section before 0.5.1). Its name is fixed in block.json and the editor script, so it is not filterable.
Accept header lists text/markdown and prefers it to text/html.Vary: Accept, so a CDN or proxy cache that honours it keeps the HTML and Markdown versions of a page apart.Link header with rel="alternate"; type="text/markdown", so an agent that reads response headers can discover the Markdown version without knowing to ask for it./llms.txt and /llms-full.txt send Cache-Control: public, max-age=3600./llms.txt and /llms-full.txt are flushed whenever the llms.txt document is saved, including when its draft is first created.LiteSpeed’s page cache ignores Vary: Accept, so without help it would serve a cached Markdown version of a page to browsers, or a cached HTML page to Markdown requests. On a LiteSpeed server the plugin therefore adds this block to the top of the root .htaccess, which gives Markdown requests a cache of their own:
# BEGIN LH AI Legibility LiteSpeed Cache
<IfModule LiteSpeed>
RewriteEngine On
RewriteCond %{HTTP:Accept} text/markdown [NC]
RewriteRule ^ - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+ismarkdown]
</IfModule>
# END LH AI Legibility LiteSpeed Cache+ismarkdown, so a block added by hand is left alone. It is never added if the file cannot be read or written directly.If the site uses any other full-page cache, check that it varies on Accept. Either exclude /llms.txt and /llms-full.txt from it or make sure it clears when the llms.txt document is saved, otherwise edits will not show until the cached copy expires.