samuelreichor / craft-llmify
Optimize your site for LLMs
Package info
github.com/samuelreichor/craft-llmify
Type:craft-plugin
pkg:composer/samuelreichor/craft-llmify
Requires
- php: >=8.2
- amphp/http-client: ^5.3
- craftcms/cms: ^5.0.0
- league/html-to-markdown: ^5.1
- paquettg/php-html-parser: ^2.2
Requires (Dev)
- craftcms/ecs: dev-main
- craftcms/phpstan: dev-main
README
Supercharge Your Craft CMS Content for AI
LLMify makes your Craft CMS content instantly AI-ready. It transforms your templates into clean, structured outputs, giving you full control over what's included.
Why LLMify?
AI models like ChatGPT struggle to read websites built for people. They see a wall of code, menus, ads, and sidebars. This "noise" makes it hard for them to find the real story - your valuable story. LLMify solves this by converting your Twig templates into clean, structured Markdown.
LLMify is built for production-scale AI content delivery. Instead of converting HTML to Markdown on every request, LLMify does the work upfront. Your Markdown is stored and ready before any bot shows up. Combined with Craft Commerce compatibility, granular control over your Markdowns and user permissions, LLMify gives you everything you need to make your entire site AI-ready.
Features
Content Generation
- Pre-Generated Markdown: Async batch processing with amphp stores Markdown in a dedicated database table for instant delivery at any scale.
- On-Demand Fallback: Automatically generates Markdown on first request if not yet pre-generated.
- Template-Level Control: Use
{% llmify %}and{% excludellmify %}Twig tags for precise control over what content is included in your Markdown output. - CSS Class Exclusion: Define classes to exclude entire sections from the HTML-to-Markdown conversion.
- YAML Front Matter: Configurable metadata with hierarchical inheritance (Site > Section > Entry).
- Console Commands:
llmify/markdown/generateandllmify/markdown/clearfor CI/CD and deployment workflows.
AI Content Delivery
- Auto-Serve Markdown: Content negotiation via
Accept: text/markdownheader. - AI Crawler Detection: Automatically serve Markdown to known AI bots (GPTBot, ClaudeBot, ChatGPT-User, and more).
- LLM-Ready Text Files: Generates
llms.txt,llms-full.txt, and/.well-known/llms.txt. - Discovery Tag: Injects
<link rel="alternate" type="text/markdown">into your HTML head. - Industry Standard Response Headers: Sets
Vary: Accept(+User-Agentfor auto-serve),X-Robots-Tag: noindex, nofollow, andLink: rel="canonical"on all Markdown responses.
Content Management
- Hierarchical Settings: Site-wide, section, and entry-level configuration with inheritance.
- Per-Entry Control: Include or exclude individual entries via the LLMify Settings Field.
- Permission System: Granular user permissions for everything.
- Preview Targets: Preview Markdown output directly from the entry editor.
- Dashboard: Site setup scores and section-level content statistics at a glance.
Integrations
- SEOmatic Integration: Automatically populate front matter from SEOmatic fields.
- Craft Commerce Support: Full support for Commerce Products alongside Entries.
Requirements
This plugin requires Craft CMS 5.0.0 or later, and PHP 8.2 or later.
Documentation
Visit the LLMify documentation for all documentation, guides, and developer resources.
Support
If you encounter bugs or have feature requests, please submit an issue. Your feedback helps improve the plugin!