@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/portfolio/lh-ai-legibility/>
  a sioc:Post ;
  dc:title "Developer reference" ;
  dcterms:identifier 148910 ;
  dc:modified "2026-10-13T03:55:48Z"^^xsd:dateTime ;
  dc:created "2026-10-01T16:24:54Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-ai-legibility/developer-reference/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded """<ul class="lh_portfolio-meta"><li><strong>Part of:</strong> <a href="https://lhero.org/portfolio/lh-ai-legibility/">LH AI Legibility</a></li></ul><h2 class="wp-block-heading">Filters</h2><figure class="wp-block-table"><table><thead><tr><th>Filter</th><th>Arguments</th><th>Use</th></tr></thead><tbody><tr><td><code>lh_ai_legibility_init_plugin</code></td><td><code>bool $init</code></td><td>Return <code>false</code> to switch the plugin off without deactivating it.</td></tr><tr><td><code>lh_ai_legibility_markdown_enabled</code></td><td><code>bool $enabled</code>, <code>WP_Post $post</code></td><td>Return <code>false</code> 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.</td></tr><tr><td><code>lh_ai_legibility_markdown_output</code></td><td><code>string $markdown</code>, <code>WP_Post $post</code></td><td>Change a post&#8217;s Markdown, without its front matter, both in a response to an <code>Accept: text/markdown</code> request and where the post appears in llms-full.txt.</td></tr><tr><td><code>lh_ai_legibility_archive_markdown_enabled</code></td><td><code>bool $enabled</code>, <code>WP_Query $query</code></td><td>Return <code>false</code> to stop serving an archive page, or all of them, as Markdown.</td></tr><tr><td><code>lh_ai_legibility_archive_item_summary</code></td><td><code>string $summary</code>, <code>WP_Post $post</code></td><td>The one-line summary after a post&#8217;s link on an archive page served as Markdown. By default its excerpt, only when one was written; empty for none.</td></tr><tr><td><code>lh_ai_legibility_llms_txt_output</code></td><td><code>string $output</code></td><td>Change the final <code>/llms.txt</code> output.</td></tr><tr><td><code>lh_ai_legibility_llms_full_output</code></td><td><code>string $output</code></td><td>Change the final <code>/llms-full.txt</code> output.</td></tr><tr><td><code>lh_ai_legibility_return_max_http_checks</code></td><td><code>int $max</code></td><td>Most links the llms.txt abilities request over HTTP in one call, when asked to check every link. Default 25.</td></tr></tbody></table></figure><h2 class="wp-block-heading">Identifiers</h2><p class="wp-block-paragraph">Each identifier is returned by a static method on <code>LH_AI_Legibility_Llms_Txt</code> 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.</p><figure class="wp-block-table"><table><thead><tr><th>Filter</th><th>Default</th><th>What it names</th></tr></thead><tbody><tr><td><code>lh_ai_legibility_return_post_type</code></td><td><code>llms_txt_document</code></td><td>The llms.txt document post type</td></tr><tr><td><code>lh_ai_legibility_return_index_query_var</code></td><td><code>lh_llms_txt</code></td><td>The query variable behind <code>/llms.txt</code></td></tr><tr><td><code>lh_ai_legibility_return_full_query_var</code></td><td><code>lh_llms_full_txt</code></td><td>The query variable behind <code>/llms-full.txt</code></td></tr><tr><td><code>lh_ai_legibility_return_document_option_name</code></td><td><code>lh_ai_legibility_document_id</code></td><td>The option holding the site&#8217;s document ID</td></tr></tbody></table></figure><p class="wp-block-paragraph">The section block is <code>lh-ai-legibility/section</code> (named <code>llms-txt/section</code> before 0.5.1). Its name is fixed in <code>block.json</code> and the editor script, so it is not filterable.</p><h2 class="wp-block-heading">What is served as Markdown</h2><ul class="wp-block-list"><li>Any single post, page or other singular post type, when the request&#8217;s <code>Accept</code> header lists <code>text/markdown</code> and prefers it to <code>text/html</code>.</li><li>Never a private post, and never a post with a password, even to a visitor who has entered it, since a Markdown response can be cached.</li><li>The front matter gives title, URL, dates, post type, the excerpt only when one has been written, and the first category if there is one.</li><li>Archive pages (the posts page, and post type, taxonomy, date and author archives) as a list of links to the same posts, in the same order and with the same paging as the HTML page, each with its summary. The front matter gives the page number and total pages, and the list ends with links to the previous and next pages. Search results and feeds are not served as Markdown.</li></ul><h2 class="wp-block-heading">Headers and caching</h2><ul class="wp-block-list"><li>HTML responses carry <code>Vary: Accept</code>, so a CDN or proxy cache that honours it keeps the HTML and Markdown versions of a page apart.</li><li>HTML responses for posts and archive pages that can be served as Markdown also carry a <code>Link</code> header with <code>rel="alternate"; type="text/markdown"</code>, so an agent that reads response headers can discover the Markdown version without knowing to ask for it.</li><li>Markdown responses, <code>/llms.txt</code> and <code>/llms-full.txt</code> send <code>Cache-Control: public, max-age=3600</code>.</li><li>Rewrite rules for <code>/llms.txt</code> and <code>/llms-full.txt</code> are flushed whenever the llms.txt document is saved, including when its draft is first created.</li></ul><h2 class="wp-block-heading">LiteSpeed</h2><p class="wp-block-paragraph">LiteSpeed&#8217;s page cache ignores <code>Vary: Accept</code>, 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 <code>.htaccess</code>, which gives Markdown requests a cache of their own:</p><pre class="wp-block-code"><code># BEGIN LH AI Legibility LiteSpeed Cache
&lt;IfModule LiteSpeed&gt;
RewriteEngine On
RewriteCond %{HTTP:Accept} text/markdown [NC]
RewriteRule ^ - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+ismarkdown]
&lt;/IfModule&gt;
# END LH AI Legibility LiteSpeed Cache</code></pre><ul class="wp-block-list"><li>It is added on activation, and checked at most once a day when someone who can install plugins opens wp-admin on the main site.</li><li>It is only added if it is not already there, found by its marker or by <code>+ismarkdown</code>, so a block added by hand is left alone. It is never added if the file cannot be read or written directly.</li><li>It goes at the top because a rule after WordPress&#8217;s own rewrite never runs.</li><li>It is not removed on deactivation. Left in place it only splits the cache, so remove it by hand if you no longer want it.</li></ul><p class="wp-block-paragraph">If the site uses any other full-page cache, check that it varies on <code>Accept</code>. Either exclude <code>/llms.txt</code> and <code>/llms-full.txt</code> from it or make sure it clears when the llms.txt document is saved, otherwise edits will not show until the cached copy expires.</p>"""^^rdf:XMLLiteral ;
  sioc:content """Part of: LH AI LegibilityFiltersFilterArgumentsUselh_ai_legibility_init_pluginbool $initReturn false to switch the plugin off without deactivating it.lh_ai_legibility_markdown_enabledbool $enabled, WP_Post $postReturn 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_outputstring $markdown, WP_Post $postChange a post&#8217;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_enabledbool $enabled, WP_Query $queryReturn false to stop serving an archive page, or all of them, as Markdown.lh_ai_legibility_archive_item_summarystring $summary, WP_Post $postThe one-line summary after a post&#8217;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_outputstring $outputChange the final /llms.txt output.lh_ai_legibility_llms_full_outputstring $outputChange the final /llms-full.txt output.lh_ai_legibility_return_max_http_checksint $maxMost links the llms.txt abilities request over HTTP in one call, when asked to check every link. Default 25.IdentifiersEach 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.FilterDefaultWhat it nameslh_ai_legibility_return_post_typellms_txt_documentThe llms.txt document post typelh_ai_legibility_return_index_query_varlh_llms_txtThe query variable behind /llms.txtlh_ai_legibility_return_full_query_varlh_llms_full_txtThe query variable behind /llms-full.txtlh_ai_legibility_return_document_option_namelh_ai_legibility_document_idThe option holding the site&#8217;s document IDThe 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.What is served as MarkdownAny single post, page or other singular post type, when the request&#8217;s Accept header lists text/markdown and prefers it to text/html.Never a private post, and never a post with a password, even to a visitor who has entered it, since a Markdown response can be cached.The front matter gives title, URL, dates, post type, the excerpt only when one has been written, and the first category if there is one.Archive pages (the posts page, and post type, taxonomy, date and author archives) as a list of links to the same posts, in the same order and with the same paging as the HTML page, each with its summary. The front matter gives the page number and total pages, and the list ends with links to the previous and next pages. Search results and feeds are not served as Markdown.Headers and cachingHTML responses carry Vary: Accept, so a CDN or proxy cache that honours it keeps the HTML and Markdown versions of a page apart.HTML responses for posts and archive pages that can be served as Markdown also carry a 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.Markdown responses, /llms.txt and /llms-full.txt send Cache-Control: public, max-age=3600.Rewrite rules for /llms.txt and /llms-full.txt are flushed whenever the llms.txt document is saved, including when its draft is first created.LiteSpeedLiteSpeed&#8217;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
&lt;IfModule LiteSpeed&gt;
RewriteEngine On
RewriteCond %{HTTP:Accept} text/markdown [NC]
RewriteRule ^ - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+ismarkdown]
&lt;/IfModule&gt;
# END LH AI Legibility LiteSpeed CacheIt is added on activation, and checked at most once a day when someone who can install plugins opens wp-admin on the main site.It is only added if it is not already there, found by its marker or by +ismarkdown, so a block added by hand is left alone. It is never added if the file cannot be read or written directly.It goes at the top because a rule after WordPress&#8217;s own rewrite never runs.It is not removed on deactivation. Left in place it only splits the cache, so remove it by hand if you no longer want it.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.""" ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
