Provides a generated site.tld/llms.md endpoint for WordPress using cached AI-driven site analysis.
New to llms.md? See What is llms.md? for background.
- WordPress 7.0+
- PHP 8.3+
- Configured WP Core AI connector
- Download
llms-md.zip - Go to Plugins > Add New > Upload Plugin
- Upload the zip file and activate
- Configure at least one WP Core AI provider connector
- Go to Settings > llms.md and run Regenerate llms.md
If a release zip is not available yet, install from source by cloning this repository into your WordPress plugins directory and activating llms-md.
- Owns only
/llms.md(no custom path). - Uses cached snapshot regeneration, not per-request generation.
- Defers to a physical web-root
llms.mdfile when present. - Regenerates on public content changes plus a daily safety rebuild.
- Requires AI connector; serves
503withRetry-Afterwhen missing. - Serves stale snapshot for up to 7 days after generation failures, then returns
503.
The plugin supports two integration paths:
- Automatic best-effort via
wp_ai_client_prompt(...)->generate_text()when available. - Recommended filter-based integration for connector-specific behavior.
add_filter('llms_md_ai_connector_configured', function ($configured) {
if (is_bool($configured)) {
return $configured;
}
// Replace with your own WP Core AI connector check.
if (!function_exists('wp_get_connectors')) {
return false;
}
foreach (wp_get_connectors() as $connector) {
if (($connector['type'] ?? '') !== 'ai_provider') {
continue;
}
$auth = $connector['authentication'] ?? [];
if (($auth['method'] ?? '') === 'none') {
return true;
}
}
return false;
});add_filter('llms_md_generate_document', function ($document, array $payload, array $context) {
if (is_string($document) && trim($document) !== '') {
return $document;
}
// Replace this with your WP Core AI call.
if (function_exists('wp_ai_client_prompt')) {
$prompt = 'Generate llms.md from payload: ' . wp_json_encode($payload);
$result = wp_ai_client_prompt($prompt)
->using_temperature(0.0)
->using_candidate_count(1)
->generate_text();
if (is_string($result) && trim($result) !== '') {
return $result;
}
}
return $document;
}, 10, 3);- Admin status page:
Settings -> llms.md - Manual rebuild capability:
manage_options - Regeneration policy: single-flight lock + coalesced rerun + 5-minute minimum successful-run interval
- Diagnostics panel:
Check ConnectorandPreview Payloadactions inSettings -> llms.md
- If
llms_md_provider_idfilter returns a non-empty provider ID, that provider is used. - Else, if
llms_md_model_idis set to a registered connector ID, that provider is used. - Else, the first configured AI provider connector is selected automatically.
Uses soderlind/wordpress-github-updater for update checks from:
- Repository:
https://github.com/soderlind/llms-md - Release asset:
llms-md.zip(regex:/llms-md\.zip/)
Optional GitHub token sources:
- Constant:
LLMS_MD_GITHUB_TOKEN - Filter:
llms_md_github_auth_token
Release zips must include vendor/ dependencies.
Two workflows are included in .github/workflows/ for GitHub updater compatibility:
on-release-add.zip.ymlbuildsllms-md.zipand uploads it to published releases.manually-build-zip.ymlbuildsllms-md.zipon demand and can upload to a tag release.
- Activate plugin and visit
/llms.md. - Confirm rewrite works and headers are present (
Content-Type,ETag,Last-Modified,X-LLMS-MD-Generated-At). - Confirm
503behavior when connector is not configured. - Trigger content edits and verify scheduled regeneration updates snapshot metadata.
This plugin includes a WordPress PHPUnit scaffold in tests/.
Install local test dependencies:
composer installRun DB-free unit tests first (Brain Monkey):
composer testEquivalent explicit unit command:
composer test:unitRun tests using vendor-installed wp-phpunit helpers:
composer test:wpThe default test config file is tests/wp-tests-config.php. You can override DB values with environment variables:
WP_TESTS_DB_NAMEWP_TESTS_DB_USERWP_TESTS_DB_PASSWORDWP_TESTS_DB_HOSTWP_PHP_BINARYWP_TESTS_WP_PATH
Alternative with a custom WordPress test library path:
export WP_TESTS_DIR=/path/to/wordpress-tests-lib
phpunit -c phpunit.xml.distWhen AI tools contribute to this plugin, include attribution in commit messages or release notes using:
Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]
Example:
Assisted-by: GitHub Copilot:GPT-5.3-Codex