Download the PHP package roots/acorn-llms-txt without Composer
On this page you can find all versions of the php package roots/acorn-llms-txt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download roots/acorn-llms-txt
More information about roots/acorn-llms-txt
Files in roots/acorn-llms-txt
Package acorn-llms-txt
Short Description LLMs text processing package for Roots Acorn.
License MIT
Informations about the package acorn-llms-txt
Acorn LLMs.txt
Expose your WordPress site content through /llms.txt endpoints following the llmstxt.org specification. This makes your WordPress content easily accessible to Large Language Models (LLMs) in a structured, markdown format.
Support us
Roots is an independent open source org, supported only by developers like you. Your sponsorship funds WP Packages and the entire Roots ecosystem, and keeps them independent. Support us by purchasing Radicle or sponsoring us on GitHub — sponsors get access to our private Discord.
Features
- llmstxt.org compliant: Implements the standard specification for LLM-readable content
- Multiple endpoints:
/llms.txt(listing),/llms-full.txt(complete content),/llms-small.txt(excerpts), individual post endpoints - XML sitemap integration:
/llms-sitemap.xmlwith automatic SEO plugin integration (Yoast, RankMath, The SEO Framework, WordPress core) - SEO integration: Respects noindex settings and adds X-Robots-Tag headers to prevent search engine indexing
- WooCommerce support: Product SKUs, prices, and metadata automatically included
- Hierarchical pages: Displays page hierarchy with proper indentation
- High performance: Built-in Laravel Cache integration with automatic invalidation
- WordPress shortcode processing: Converts shortcodes to readable content before markdown conversion
- Extensible: Developer hooks and filters for customization
- Configurable: Comprehensive configuration options for content filtering and formatting
Installation
Install via Composer:
Publish the configuration file:
Endpoints
/llms.txt
A structured listing of your site content (like a table of contents):
/llms-full.txt
Complete content of all posts and pages in markdown format:
/llms-small.txt
Compressed version with excerpts only for faster processing:
/llms-sitemap.xml
XML sitemap listing all llms.txt endpoints, automatically integrated with SEO plugins.
Individual Post Endpoints (Optional)
Access individual posts via /post-slug.txt (disabled by default for performance).
Configuration
After publishing, edit config/llms-txt.php:
Post Types
Content Processing
Content Limits
Exclusions
Individual Post Endpoints
Caching
WooCommerce Integration
SEO Integration
The package automatically respects SEO plugin settings and integrates with their sitemaps:
Content Filtering:
- Yoast SEO: Excludes posts/pages with noindex meta
- RankMath: Excludes posts/pages with noindex settings
- The SEO Framework: Excludes posts/pages marked as noindex
Sitemap Integration:
- Yoast SEO: Adds
/llms-sitemap.xmlto main sitemap index - RankMath: Registers llms sitemap in sitemap array
- The SEO Framework: Creates custom sitemap endpoint
- WordPress Core: Integrates with wp_sitemaps system
Search Engine Protection:
- Adds
X-Robots-Tag: noindexheader to all llms.txt endpoints to prevent search engine indexing
Posts marked as noindex by SEO plugins will not appear in any llms.txt endpoints.
WP-CLI Commands
View package information
Clear cached content
Developer Hooks
Filters
Filter which post types are included:
Exclude specific posts:
Filter individual post data:
Filter the complete posts collection:
Filter the entire document before output:
Filter final content before serving:
Filter XML sitemap before serving:
Control sitemap integration:
Actions
Add custom sections before default content:
Add custom sections after default content:
Add completely custom sections:
Cache Management
The package automatically invalidates cache when:
- Posts are created, updated, or deleted
- Post status changes
- Post metadata is updated
Manual cache clearing:
Performance
This package is optimized for performance with:
- Efficient caching: Laravel Cache integration reduces database queries
- Automatic cache invalidation: Updates cache only when content changes
- Memory optimization: Designed to handle large sites with thousands of posts
- Configurable limits: Control content length and post counts to manage resource usage
Troubleshooting
Cache Issues
If content isn't updating, clear the cache:
Routes Not Working
Ensure Acorn routes are optimized:
Performance on Large Sites
For sites with many posts, adjust limits in config/llms-txt.php:
Requirements
- PHP 8.2+
- WordPress with Acorn
Community
Keep track of development and community news.
- Join us on Discord by sponsoring us on GitHub
- Join us on Roots Discourse
- Follow @rootswp on Twitter
- Follow the Roots Blog
- Subscribe to the Roots Newsletter