Botkibble
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. GitHub Repository Three ways to request Markdown: .md suffix: append .md to any post or page URL (e.g. example.com/my-post.md) Query parameter: add ?format=markdown to any post or page URL Content negotiation: send Accept: text/markdown in the request header What’s in every response: Structured metadata header with title, date, categories, tags, word count, character count, and estimated token count (in YAML frontmatter format, readable by any AI agent) Clean Markdown converted from fully-rendered post HTML (shortcodes run, filters applied) Content-Type: text/markdown and Vary: Accept response headers Content-Signal header for AI signal declaration — defaults to ai-train=no, search=yes, ai-input=yes — see contentsignals.org X-Markdown-Tokens header with estimated token count Discovery via in the HTML head and Link HTTP header Automatic cache invalidation when a post is updated or deleted Performance: 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: Drafts, private posts, and password-protected content return 403 Forbidden Rate limits cache-miss regenerations (20/min by default) to mitigate DoS abuse X-Robots-Tag: noindex keeps Markdown versions out of search results Link: rel="canonical" points search engines back to the HTML version Cache 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/ / .md What it does NOT do: Expose drafts, private posts, or password-protected content Serve non-post/page content types by default Require any configuration. Activate and it works. Why Markdown? 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. Performance & Static Offloading This plugin supports static file offloading by writing Markdown content to /wp-content/uploads/botkibble/. Nginx Configuration 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; } Apache (.htaccess) 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. Credits We thank Cristi Constantin (https://github.com/cristi-constantin) for contributing cache variants, URL and SEO improvements, and fixing important bugs.
Top keywords
- markdown24×3.18%
- md16×2.12%
- botkibble15×1.99%
- text8×1.06%
- text markdown8×1.06%
- uploads8×1.06%
- uploads botkibble8×1.06%
- wp-content8×1.06%
- wp-content uploads8×1.06%
- wp-content uploads botkibble8×1.06%
- content7×0.93%
- header7×0.93%
Markdown for Agents and Statistics
Markdown for Agents and Statistics converts your WordPress content to Markdown and serves it to AI agents and language model tools that request it via HTTP content negotiation (Accept: text/markdown). The Chancery Lane Project is a charity that helps organisations reduce emissions using the power of legal documents and processes. We’ve published this plugin as we believe that making content more legible for AI Agents makes a meaningful difference to their energy usage – not only by reducing the amount of tokens required (by up to 90% over HTML) to consume the content, but also minimising the server resources required to render, process and display pages at source. How it works: Posts and taxonomy archive pages are converted to Markdown and saved as static files on disk inside wp-content/uploads/. When a visitor (or AI agent) requests a page with Accept: text/markdown in the HTTP headers, WordPress serves the pre-generated .md file directly — no page render required. A tag is added to each page’s so agents can discover Markdown versions automatically. Features: Content negotiation (Accept: text/markdown, ?output_format=md, or known AI User-Agents) Taxonomy archive support — category, tag, and custom taxonomy term pages served as Markdown post listings Automatic Markdown generation on post save; taxonomy archives auto-update when any post in the term changes Background bulk generation — runs as a WP-Cron job with live progress, so it survives closing the tab and never times out a page request Per-post-type field configuration — choose which meta/ACF fields go in frontmatter or body ACF support with dot notation for nested group fields (e.g. group.subfield) Content fields option — use ACF fields as the body content instead of post_content Manifest generation with content hashes and change tracking per post type Incremental export — only re-export changed documents (--incremental) Delta file (changes.json) for RAG system sync Access statistics — logs AI agent requests with a dedicated stats admin page Access grouping by class of agent Optional frontmatter fields — hierarchy (parent/ancestors/children IDs), author display name, root-relative featured image paths Topics section — appends a ## Topics section with linked taxonomy terms to the Markdown body Export preview — preview generated Markdown inline in the post editor without writing to disk OKF directory indexes — index.md listings at the export root and in every post-type and taxonomy directory (Open Knowledge Format), kept current automatically OKF-compliant frontmatter and links — timestamp and flat cross-taxonomy tags frontmatter keys, and internal links rewritten to point at the Markdown file versions, always on Downloadable OKF bundle — optional .zip archive of the export tree with relative internal links, manifest.json, and an ARD discovery catalog panel, kept fresh via bulk-generation rebuilds and a debounced WP-Cron schedule ARD catalog generation — ai-catalog.json document for manual deployment to /.well-known/, discoverable by AI agent directories, shown automatically whenever the bundle toggle is on WP-CLI commands: generate, generate-taxonomies, generate-indexes, prune-stats, status, delete, bundle Fully unit-tested