Hooks
Filters and actions for developers. Put them in a small plugin or your theme's functions.php.
Settings and output
| Filter | Receives | Use it to |
|---|
ltxt_settings | the settings array | change settings in code |
ltxt_document | llms.txt, settings | edit the finished llms.txt |
ltxt_full_document | llms-full.txt, settings | edit the finished llms-full.txt |
ltxt_credit_line | the credit line | word the optional credit your own way |
ltxt_agency | ['name', 'url'] | change the name in the admin footer |
ltxt_content_type | the Content-Type, txt or md | serve text/markdown instead of text/plain |
ltxt_robots_reference | true | stop the llms.txt line in robots.txt |
What gets in
| Filter | Receives | Use it to |
|---|
ltxt_can_serve | allowed, post, context | the one rule for publishing a post: manifest, pinned, markdown, index or head |
ltxt_include_post | include, post | leave a post out of llms.txt |
ltxt_section_posts | posts, section | reorder or change a section's posts |
ltxt_is_noindex | noindex, post ID | read noindex from another SEO plugin |
ltxt_seo_description_keys | meta keys | read descriptions from another SEO plugin |
ltxt_serve_markdown | allowed, post | refuse a .md copy for some posts |
// Keep a members area out of everything the plugin publishes.
add_filter( 'ltxt_can_serve', function ( $allowed, $post, $context ) {
return $allowed && ! has_term( 'members', 'category', $post );
}, 10, 3 );
Markdown
| Filter | Receives | Use it to |
|---|
ltxt_post_markdown | Markdown, post | edit a page's .md copy |
ltxt_markdown_drop_classes | class names | remove more page furniture before conversion |
ltxt_apply_content_filters | true, post | skip the_content filters for a post |
Search API
| Filter | Receives | Use it to |
|---|
ltxt_is_indexable | indexable, post | keep a post out of the search index |
ltxt_search_results | results, query | rerank or edit results |
ltxt_client_ip | the REMOTE_ADDR address | read the visitor's address behind a proxy, for the rate limits |
// Behind Cloudflare: count visitors, not Cloudflare. Only trust a header your proxy sets.
add_filter( 'ltxt_client_ip', function ( $ip ) {
return isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) : $ip;
} );
Structured data and Scan my site
| Filter | Receives | Use it to |
|---|
ltxt_schema | JSON-LD data, settings | edit the Organization block |
ltxt_schema_conflicts | plugin names | add an SEO plugin to the warning |
ltxt_suggestions | suggestions | change what Scan my site fills in |
ltxt_contact_slugs | page slugs | help Scan my site find your contact page |
| Filter | Receives | Use it to |
|---|
ltxt_render_widget | true | hide the widget on some pages |
ltxt_faq_match | match, question, entries | change which curated answer matches |
ltxt_faq_stopwords | words | change the words curated matching ignores |
ltxt_synonyms | groups | add or change the groups of words that mean the same (lower case, no accents) |
ltxt_faq_import_candidates | candidates, source | edit what "Bring them in" finds |
// No chat window on checkout pages.
add_filter( 'ltxt_render_widget', function ( $render ) {
return $render && ! ( function_exists( 'is_checkout' ) && is_checkout() );
} );
AI answers
| Filter | Receives | Use it to |
|---|
ltxt_chat_system_prompt | the instructions, settings | add to or change the assistant's instructions, for AI answers |
ltxt_ai_client_model_preference | [], settings | suggest models to WordPress AI, in order: model IDs, or [ provider ID, model ID ] pairs |
// WordPress AI: try one model first, then GPT-5 from OpenAI.
add_filter( 'ltxt_ai_client_model_preference', function () {
return array( 'a-model-id', array( 'openai', 'gpt-5' ) );
} );
The list is a preference, not a requirement: when none of the models is available, WordPress answers with any model its providers offer that can. Empty, the default, leaves the choice to WordPress.
Actions
| Action | Receives | Fires |
|---|
ltxt_rebuilt | the cache, with both documents | after llms.txt (and llms-full.txt) are rebuilt |
ltxt_index_complete | nothing | when the search index has finished a full rebuild |