purpletree / magento2-llms-txt-generator
Magento 2 LLMs TXT Generator - Generate and auto-update llms.txt for better AI visibility
Purpletree LLMs TXT Generator for Magento 2
Overview
This extension allows you to generate and auto-update an llms.txt file for your Magento 2 store. The llms.txt file helps AI systems understand your store content better and improves AI visibility and citations.
Features
- Automatic Generation: Schedule automatic generation of llms.txt file via cron
- Manual Generation: Generate the file instantly from admin panel
- Company Information: Add company name and description to the file
- Store URL: Include your store base URL in the file
- Product Inclusion: Include products with customizable fields
- Category Inclusion: Add store categories with custom attributes
- CMS Pages: Include CMS pages with selectable fields
- Blog Support: Full support for:
- Blog Categories
- Blog Posts
- Blog Tags
- Blog Authors
- Custom Content: Add markdown content to the end of the file
- Error Handling: Get email notifications for generation errors
- Flexible Configuration: Select specific fields/attributes for each content type
- Per-Item Control: Override settings at product, category, page, or post level
Installation
Via Composer
composer require purpletree/magento2-llms-txt-generator
php bin/magento module:enable Purpletree_LlmsTxtGenerator
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
Manual Installation
- Extract the extension files to
app/code/Purpletree/LlmsTxtGenerator/ - Run the following commands:
php bin/magento module:enable Purpletree_LlmsTxtGenerator
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
Configuration
Navigate to Stores > Configuration > Magefan Extensions > LLMs TXT Generator
General Settings
- Enable Extension: Enable/disable the entire extension
Company Information
- Company Name: Main heading for the llms.txt file
- Company Description: Brief summary of your business
Store URL Options
- Include in LLMs.txt: Add store base URL to the file
Categories Options
- Include in LLMs.txt: Enable/disable category inclusion
- Use Fields: Select category attributes to include (Children Count, Description, Level, Name, etc.)
- Max. Number To Include: Maximum categories to include
Products Options
- Include in LLMs.txt: Enable/disable product inclusion
- Use Fields: Select product attributes to include (Categories, Description, Name, Price, SKU, etc.)
- Max. Number To Include: Maximum products to include (default: 100)
CMS Pages Options
- Include in LLMs.txt: Enable/disable CMS page inclusion
- Use Fields: Select page fields (Title, Content, Meta Description, etc.)
- Max. Number To Include: Maximum CMS pages to include (default: 50)
Blog Category Options
- Include in LLMs.txt: Enable/disable blog category inclusion
- Use Fields: Select attributes to include
- Max. Number To Include: Maximum blog categories (default: 50)
Blog Posts Options
- Include in LLMs.txt: Enable/disable blog post inclusion
- Use Fields: Select post fields to include
- Max. Number To Include: Maximum blog posts (default: 100)
Blog Tags Options
- Include in LLMs.txt: Enable/disable blog tag inclusion
- Use Fields: Select tag attributes to include
- Max. Number To Include: Maximum blog tags (default: 50)
Blog Authors Options
- Include in LLMs.txt: Enable/disable blog author inclusion
- Use Fields: Select author fields (Bio, Meta fields, etc.)
- Max. Number To Include: Maximum blog authors (default: 20)
Custom Content
- Custom Content: Add markdown-formatted content to append at the end of llms.txt
Generation Settings
- Enabled: Enable automatic cron-based generation
- Error Email Recipient: Email address for error notifications
- Error Email Sender: Email identity for error emails
- Error Email Template: Template for error email
- Frequency: Generation frequency (Daily, Weekly, Monthly)
- Start Time: Time to start generation (24-hour format)
- Generate LLMs.txt: Button to manually generate the file immediately
- LLMs.txt File(s): Displays URL to the generated file
Usage
Automatic Generation
- Enable "Enable Automatic Generation" in Generation Settings
- The file will be generated automatically via cron at the scheduled time
- Check for error emails if generation fails
Manual Generation
- Go to Stores > Configuration > Magefan Extensions > LLMs TXT Generator
- Scroll to Generation Settings section
- Click the "Generate Now" button
- A success or error message will be displayed
Per-Item Configuration
You can override global settings for specific items:
- For Products: Go to Catalog > Products, scroll to "Generative Engine Optimization"
- For Categories: Go to Catalog > Categories, scroll to "Generative Engine Optimization"
- For CMS Pages: Go to Content > Pages, scroll to "Generative Engine Optimization"
- For Blog Items: Access through the respective blog admin sections
Set "Include in LLMs.txt" to "Yes" (with higher priority) or "No" to override global settings
Access the File
The generated llms.txt file is located at:
https://yourstore.com/llms.txt
File Structure
The generated llms.txt file includes:
# Company Name
Company Description
## Store URL
https://yourstore.com/
## Products
### Product Name
URL: https://yourstore.com/product-url
selected_field_1: value
selected_field_2: value
## Categories
### Category Name
URL: https://yourstore.com/category-url
selected_field_1: value
## CMS Pages
### Page Title
content_preview...
## Blog Categories
### Category Name
content...
## Blog Posts
### Post Title
short_content...
## Blog Tags
### Tag Name
content...
## Blog Authors
### Author Name
author_bio...
## Custom Content
Your custom markdown content...
Requirements
- Magento 2.3+
- PHP 7.1+
FAQ
Can I include only specific products?
Yes! Set "Include in LLMs.txt" to "No" at the global level, then go to each product and enable "Include in LLMs.txt" in the Generative Engine Optimization section for specific products only.
Is the llms.txt file submitted to AI crawlers?
No. The llms.txt file is placed in your Magento root (like robots.txt). AI crawlers can find it at yourstore.com/llms.txt just like they find robots.txt.
How large should the llms.txt file be?
It's recommended to keep it between 100-200 links for optimal AI crawler performance and understanding.
Can I use markdown in Custom Content?
Yes! Custom Content fully supports markdown formatting.
Support
For issues and feature requests, please contact [email protected]
License
This extension is licensed under the Open Software License (OSL 3.0)
Version
1.0.0 - Initial Release
2.0.0 - Added Blog support, per-item controls, multiselect fields
2.0.1 - Bug fixes and improvements
No changelog yet
The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.
Requires 5
| Package | Constraint |
|---|---|
| magento/framework | >=103.0 <104.0 |
| magento/module-catalog | >=104.0 <105.0 |
| magento/module-cms | >=104.0 <105.0 |
| magento/module-store | >=101.1 <102.0 |
| php | ~8.3.0 || ~8.4.0 || ~8.5.0 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. A phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 82 | 82 warnings (ruleset: Magento2), 1 auto-fixable with phpcbf |
| PHPMD | Warning | 9 | 9 rule violations (UnusedFormalParameter:4, MissingImport:3, CyclomaticComplexity:1, NPathComplexity:1) |
| Cpd | Pass | 0 | |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Integration tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
Turn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.