AI agents, LLMs, and crawlers have to wade through navigation bars, sidebars, ads, and comment forms to reach the content they want, and every element costs tokens. Cloudflare measured an 80% reduction in token usage when converting a blog post from HTML to Markdown (16,180 tokens down to 3,150).
Botkibble adds a Markdown endpoint to every published post and page.
Cloudflare offers Markdown for Agents at the CDN edge on Pro, Business, and Enterprise plans. Botkibble does the same thing (for free) at the origin, so it works on any host.
Three ways to request Markdown:
.md suffix: append .md to any post or page URL (e.g. example.com/my-post.md)?format=markdown to any post or page URLAccept: text/markdown in the request headerWhat’s in every response:
Content-Type: text/markdown and Vary: Accept response headersContent-Signal header for AI signal declaration — defaults to ai-train=no, search=yes, ai-input=yes — see contentsignals.orgX-Markdown-Tokens header with estimated token count<link rel="alternate"> in the HTML head and Link HTTP headerPerformance:
Botkibble writes Markdown to disk on the first request, then serves it as a static file. A built-in Fast-Path serves cached files during WordPress’s init hook, before the main database query runs. No extra configuration needed.
Add a web server rewrite rule and Botkibble bypasses PHP entirely, serving .md files the same way a server would serve an image or CSS file:
Method
Avg. response time
Standard HTML
0.97s
Markdown (cold, first request)
0.95s
Markdown (cached, PHP Fast-Path)
0.87s
Markdown (Nginx/Apache direct)
0.11s
Serving directly from disk is 88% faster than a full WordPress page load. See the Performance section below for Nginx and Apache configuration.
Security:
403 ForbiddenX-Robots-Tag: noindex keeps Markdown versions out of search resultsLink: rel="canonical" points search engines back to the HTML versionCache variants (optional):
You can persist alternate cached representations by adding ?botkibble_variant=slim (or any other variant name).
Variant caches are stored under:
/wp-content/uploads/botkibble/_v/<variant>/<slug>.md
What it does NOT do:
HTML is expensive for AI systems to process. Cloudflare measured an 80% reduction in token usage when converting a blog post from HTML to Markdown (16,180 tokens down to 3,150).
Cloudflare now offers Markdown for Agents at the CDN edge via the Accept: text/markdown header, available on Pro, Business, and Enterprise plans.
This plugin does the same thing at the origin, so it works on any host. It also adds .md suffix URLs, ?format=markdown query parameters, YAML frontmatter, static file caching, and server-level offloading.
If you use Cloudflare, both share the same Accept: text/markdown header, Content-Signal headers, and X-Markdown-Tokens response headers.
Cloudflare currently defaults to Content-Signal: ai-train=yes, search=yes, ai-input=yes with no way to change it. Botkibble defaults to ai-train=no and lets you override the full signal per site via the botkibble_content_signal filter.
This plugin supports static file offloading by writing Markdown content to /wp-content/uploads/botkibble/.
To bypass PHP entirely and have Nginx serve the files (including variants) directly:
# Variants
location ~* ^/(_v/[^/]+/.+)\.md$ {
default_type text/markdown;
try_files /wp-content/uploads/botkibble/$1.md /index.php?$args;
}
# Default
location ~* ^/(.+)\.md$ {
default_type text/markdown;
try_files /wp-content/uploads/botkibble/$1.md /index.php?$args;
}
Add this to your .htaccess before the WordPress rules:
RewriteEngine On
# Variants
RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads/botkibble/_v/$1/$2.md -f
RewriteRule ^_v/([^/]+)/(.+)\.md$ /wp-content/uploads/botkibble/_v/$1/$2.md [L,T=text/markdown]
# Default
RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads/botkibble/$1.md -f
RewriteRule ^(.*)\.md$ /wp-content/uploads/botkibble/$1.md [L,T=text/markdown]
Even without these rules, the plugin uses a “Fast-Path” that serves cached files from PHP before the main database query is executed.
We thank Cristi Constantin (https://github.com/cristi-constantin) for contributing cache variants, URL and SEO improvements, and fixing important bugs.