A comprehensive WordPress plugin for generating and managing LLMS.TXT files with advanced features including Markdown editor, auto-sync, dynamic shortcodes, and revision history.
- Overview
- Features
- Installation
- Configuration
- Usage
- Shortcodes
- Development Steps
- Technical Architecture
- Hooks and Filters
- Database Schema
- File Structure
- Requirements
- License
LLMS Pro automatically generates and maintains an llms.txt file in your WordPress root directory. This file helps Large Language Models (LLMs) and AI systems better understand your website's structure and content, similar to how robots.txt helps search engines.
LLMS.TXT is a standardized file format that provides AI systems with a structured overview of your website's content. It includes:
- Site overview and description
- Page hierarchy
- Blog posts and categories
- Author information
- Custom post types
- Recent content updates
-
Markdown Editor with EasyMDE
- Live preview functionality
- Syntax highlighting
- Full-screen editing mode
- Auto-save drafts
- Toolbar with common formatting options
-
Auto-Sync Functionality
- Scheduled updates via WP-Cron
- Configurable frequency (hourly, twice daily, daily, weekly)
- Manual sync on demand
-
Dynamic Shortcodes
[llms_pages]- List all pages[llms_posts]- List posts with filters[llms_categories]- List categories[llms_authors]- List authors[llms_recent_content]- Recent content[llms_sitemap_tree]- Complete site structure[llms_custom_post_type]- Custom post types
-
Revision History
- Tracks up to 100 revisions
- One-click restore
- User and timestamp tracking
- File size history
-
File Management
- Automatic backups before updates
- File validation and integrity checks
- Permission management (chmod 644)
- File locking during writes
-
Content Synchronization
- Hierarchical page structure
- Category-based post organization
- Custom taxonomy support
- Author archives
- Meta data extraction
- Clean, modern UI with WordPress design standards
- Tabbed interface (Editor/Preview)
- Real-time file info display
- Quick actions sidebar
- Settings page with comprehensive options
- Log in to your WordPress dashboard
- Navigate to Plugins > Add New
- Search for "LLMS Pro"
- Click Install Now and then Activate
- Download the plugin files
- Upload to
/wp-content/plugins/llms-pro/ - Activate through the WordPress admin panel
- Navigate to LLMS Pro > Editor
After activation, the plugin will:
- Create database tables for revision history
- Generate an initial
llms.txtfile - Schedule the first auto-sync job
- Create backup directory in uploads
Navigate to LLMS Pro > Settings to configure:
- Auto-Sync: Enable/disable automatic updates
- Sync Frequency: Hourly, twice daily, daily, or weekly
- Include Content Types: Pages, posts, categories, authors
- Post Limit: Maximum number of posts (1-500)
- Custom Post Types: Select which custom post types to include
- URL Format: Absolute (https://example.com/page/) or Relative (/page/)
- Max Revisions: Number of revisions to keep (1-100)
- Remove on Deactivate: Delete file when plugin is deactivated
- Navigate to Editor: Go to LLMS Pro > Editor
- Edit Content: Use the Markdown editor to write/edit content
- Add Shortcodes: Insert dynamic shortcodes where needed
- Preview: Switch to Preview tab to see formatted output
- Save: Click Save to update the llms.txt file
# My Website
## Overview
[llms_site_info]
## All Pages
[llms_pages]
## Recent Blog Posts
[llms_posts limit="10"]
## Categories
[llms_categories]
## Recent Updates (Last 30 Days)
[llms_recent_content days="30"]Access your llms.txt file at: https://yourdomain.com/llms.txt
Lists all published pages in hierarchical structure.
[llms_pages]Output:
- Home: /
- About: /about/
- Team: /about/team/
- History: /about/history/
Lists blog posts with optional filters.
[llms_posts limit="10" category="tech" orderby="date" order="DESC"]Attributes:
limit- Number of posts (default: 50)category- Filter by category slugorderby- Sort by (date, title, etc.)order- ASC or DESC
Lists all categories with post counts.
[llms_categories]Lists all authors with post counts.
[llms_authors]Lists content from the last N days.
[llms_recent_content days="30"]Attributes:
days- Number of days to look back (default: 30)
Displays complete site structure.
[llms_sitemap_tree]Lists custom post type content.
[llms_custom_post_type type="product" limit="20" orderby="date" order="DESC"]Attributes:
type- Post type slug (required)limit- Number of items (default: 50)orderby- Sort byorder- ASC or DESC
Displays site overview information.
[llms_site_info]This section documents all the steps taken to build this plugin:
- Created main plugin class with singleton pattern
- Implemented activation/deactivation hooks
- Set up autoloading for core classes
- Defined plugin constants
- Created database schema for revision history
- Configured default options
- Set up WP-Cron for auto-sync
- Implemented file read/write operations
- Added backup system before updates
- Created revision history tracking
- Implemented file validation
- Added permission management (chmod 644)
- Created atomic file operations (write to temp, then move)
- Added file locking during writes
- Built hierarchical page structure builder
- Created post fetching with category filters
- Implemented author list generation
- Added custom post type support
- Created recent content fetcher
- Built sitemap tree generator
- Implemented URL formatting (absolute/relative)
- Registered all shortcodes
- Implemented attribute parsing and validation
- Created shortcode handlers for each type
- Added shortcode processing in generator
- Created main file generation logic
- Implemented content validation
- Added preview functionality
- Created revision management
- Implemented template system
- Created admin menu structure
- Implemented AJAX handlers for save/generate/delete
- Added settings save functionality
- Created admin notices system
- Implemented file info display
- Added revision restore functionality
- admin-page.php: Created main editor interface with tabs
- settings-page.php: Built comprehensive settings page
- Added file info display
- Created revision history sidebar
- Added shortcode reference panel
- admin-style.css:
- Modern, clean design
- Responsive layout
- Tab system styling
- Revision history styling
- Loading states
- admin-script.js:
- EasyMDE editor initialization
- AJAX operations
- Tab switching
- Preview updates
- Revision restore
- Copy to clipboard
- Created WordPress readme.txt with full plugin information
- Created README.md with comprehensive documentation
- Documented all features, hooks, and usage
The plugin follows WordPress best practices with a clean OOP structure:
LLMS_Pro (Main Class)
├── LLMS_TXT_File_Handler (File operations)
├── LLMS_TXT_Content_Sync (Content fetching)
├── LLMS_TXT_Shortcodes (Shortcode processing)
├── LLMS_TXT_Generator (Content generation)
└── LLMS_TXT_Admin (Admin interface)
- Nonce verification for all AJAX requests
- Capability checks (manage_options)
- Data sanitization and validation
- SQL injection prevention with prepared statements
- XSS protection with escaping
- File upload restrictions
- Transient caching for queries
- Batch processing for large sites
- AJAX-based generation for big files
- Efficient database queries
- Background processing via WP-Cron
Fires before file generation.
add_action('llms_txt_before_generate', function() {
// Your code here
});Fires after file generation.
add_action('llms_txt_after_generate', function($result) {
// $result is true or WP_Error
});Filter the final content before writing.
add_filter('llms_txt_content_filter', function($content) {
// Modify content
return $content;
});Customize URL formatting.
add_filter('llms_txt_url_format', function($url, $format) {
// Customize URL
return $url;
}, 10, 2);Customize site overview section.
add_filter('llms_txt_site_overview', function($overview) {
return $overview . "\nCustom info";
});Customize pages output.
add_filter('llms_txt_pages_output', function($output, $pages) {
// Modify pages output
return $output;
}, 10, 2);Filter all generated content.
add_filter('llms_txt_all_content', function($content) {
return $content . "\n\n## Custom Section\n\nCustom content";
});Stores revision history for the llms.txt file.
CREATE TABLE wp_llms_txt_history (
id bigint(20) NOT NULL AUTO_INCREMENT,
content longtext NOT NULL,
created_at datetime DEFAULT CURRENT_TIMESTAMP NOT NULL,
created_by bigint(20) NOT NULL,
file_size bigint(20) NOT NULL,
notes text,
PRIMARY KEY (id),
KEY created_at (created_at)
);Columns:
id- Unique revision IDcontent- Full content of the revisioncreated_at- Timestamp of creationcreated_by- WordPress user ID who created itfile_size- Size of content in bytesnotes- Optional notes (for future use)
llms-pro/
├── llms-pro.php # Main plugin file
├── readme.txt # WordPress readme
├── README.md # This file
├── includes/ # Core classes
│ ├── class-llms-txt-file-handler.php # File operations
│ ├── class-llms-txt-content-sync.php # Content fetching
│ ├── class-llms-txt-shortcodes.php # Shortcode handling
│ ├── class-llms-txt-generator.php # Content generation
│ └── class-llms-txt-admin.php # Admin interface
├── admin/ # Admin assets
│ ├── css/
│ │ └── admin-style.css # Admin styles
│ ├── js/
│ │ └── admin-script.js # Admin scripts
│ └── views/
│ ├── admin-page.php # Editor page
│ └── settings-page.php # Settings page
├── assets/ # Frontend assets
│ └── lib/
│ └── easymde/ # Markdown editor (CDN)
└── languages/ # Translation files
└── llms-pro.pot # Translation template
- WordPress 6.0 or higher
- PHP 8.0 or higher
- MySQL 5.6 or higher
- Write permissions for WordPress root directory
- WordPress 6.7 or higher
- PHP 8.2 or higher
- MySQL 8.0 or higher
- HTTPS enabled
- Check WordPress root directory write permissions
- Check PHP error logs
- Verify WP-Cron is running
- Check Settings > Auto-Sync is enabled
- Ensure shortcode syntax is correct
- Check the shortcode reference in the editor
- Preview content before saving
- Check for typos in shortcode names
- Check database table exists:
wp_llms_txt_history - Verify user has admin capabilities
- Check max revisions setting
Potential features for future versions:
- REST API endpoint for llms.txt
- Webhook notifications on updates
- Integration with popular SEO plugins
- Gutenberg block for content insertion
- WP-CLI commands
- Export to different formats (JSON, XML)
- A/B testing different formats
- CloudFlare cache purging integration
For support, feature requests, or bug reports:
- Website: https://msunvi.com
- GitHub: https://github.com/mainulsunvi/llms-pro
- WordPress Support: https://wordpress.org/support/plugin/llms-pro
Contributions are welcome! Please feel free to submit a Pull Request.
- Developer: Mainul Sunvi
- Markdown Editor: EasyMDE (https://github.com/Ionaru/easy-markdown-editor)
- Inspired by: The llms.txt standard
This plugin is licensed under GPL v3 or later.
Copyright 2024 Mainul Sunvi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Initial release with the following features:
- Markdown editor with EasyMDE integration
- Auto-sync functionality with WP-Cron
- Dynamic shortcodes system
- Revision history tracking (up to 100 revisions)
- Content synchronization from WordPress
- Settings page with full configuration
- File backup system
- Custom post type support
- AJAX-powered admin interface
- Translation ready
- Security hardened
- Performance optimized
Made with ❤️ for the WordPress community