Markdown for AI Agents
Markdown for AI Agents is a lightweight WordPress plugin that enables HTTP content negotiation for your site’s content. When a client (like an AI agent or a custom script) requests a page with the Accept: text/markdown header, the plugin intercepts the request and returns a clean, structured Markdown representation of the post or page content. This is ideal for AI crawlers, RAG (Retrieval-Augmented Generation) systems, and non-browser clients that prefer machine-friendly text over complex HTML. Important note: This plugin is primarily a developer/integration tool. Human visitors browsing your site will never see any difference — the Markdown output is only served when explicitly requested via the Accept: text/markdown HTTP header. Normal browser requests always receive the standard HTML page. Key Features: Automatically detects Accept: text/markdown headers. Converts HTML content to clean Markdown using the League HTMLToMarkdown library. Strips away theme layout, navigation, headers, footers, and sidebars — serving only the main content. Adds useful HTTP response headers: Content-Type: text/markdown, Vary: Accept, and X-Markdown-Word-Count. Respects WordPress visibility rules and filters. No configuration required — works out of the box for posts, pages, and custom post types. How It Works This plugin uses a standard web technique called HTTP content negotiation. The same URL on your site can serve different representations of the same content depending on what the client asks for: A regular browser sends Accept: text/html → receives your normal HTML page. An AI agent sends Accept: text/markdown → receives a clean Markdown version of the same page. No extra URLs, no duplicate content, no configuration needed. The plugin hooks into WordPress’s template_redirect action, detects the Accept header, captures the rendered HTML, converts it to Markdown, and returns it with appropriate headers. Why Markdown for AI Agents? When building RAG (Retrieval-Augmented Generation) applications or AI pipelines that ingest web content, HTML is extremely noisy. A typical WordPress page contains thousands of tokens worth of HTML tags, inline styles, navigation menus, scripts, and layout markup — none of which carries meaning for an AI model. Serving clean Markdown instead can reduce token consumption by up to 60%, which means: Lower API costs — fewer tokens ingested when loading pages into vector stores or LLM pipelines. Faster processing — less text for the model to parse, filter, and discard. Better retrieval accuracy — higher signal-to-noise ratio improves the quality of RAG results. Simpler pipelines — no need for custom HTML stripping logic on the client side; the plugin handles it server-side. Any AI agent, crawler, or ingestion script that sends Accept: text/markdown in its request header will automatically receive the clean Markdown version — no extra URLs, no separate endpoints, no changes to your content workflow.
Top keywords
- markdown15×3.38%
- content10×2.25%
- html9×2.03%
- text9×2.03%
- accept8×1.80%
- ai8×1.80%
- accept text6×1.35%
- page6×1.35%
- text markdown6×1.35%
- accept text markdown5×1.13%
- clean5×1.13%
- clean markdown4×0.90%
One-V LLM Serve
One-V LLM Serve makes every public page on your WordPress site available as clean Markdown at the same URL with a .md extension — zero configuration required. https://example.com/about/ ← HTML page for humans https://example.com/about.md ← clean Markdown for AI AI systems — ChatGPT, Perplexity, ClaudeBot, Google AI Overviews, and most RAG pipelines — parse Markdown far more efficiently than HTML. When these systems encounter an HTML page, they must strip navigation, headers, footers, sidebars, scripts, and tracking pixels before they can read the actual content. This noise introduces errors, increases token cost, and leads to lower-quality outputs. The Markdown file contains a configurable YAML frontmatter block followed by the page title, headings in correct hierarchy, and the body text. Nothing else. Core features Zero-config Markdown endpoint for every public post, page, and custom post type YAML frontmatter with configurable fields (title, date, modified, url, description, image, tags, categories, lang, type) /llms.txt discovery file at the site root following the llmstxt.org convention Taxonomy archives as Markdown — /category/news.md, /tag/foo.md, custom taxonomies ?format=markdown query parameter as an alternative to the .md URL on any singular page Per-post exclude via a sidebar checkbox on the post editor Works with Classic Editor and Gutenberg via the the_content filter ACF integration — opt-in per-post: pick which text, textarea, WYSIWYG, URL, email, or link fields to append below the body Filterable AI analytics — per-hit events with full denormalised dimensions (UA bucket, referrer host, language, post type, response code), sticky filter bar that drives every chart and table live, six KPI tiles, a stacked-area time chart, three composition donuts (UA bucket / referrer source / language), four Top tables, a User-Agent classifier transparency table, and a Recent Activity stream. Referrers are tracked by hostname only — paths and query strings are stripped before storage so no PII is retained. Forward-compatible classification: when the bot or referrer catalogue is updated in a future release, historical rows are reclassified automatically — no Reset Analytics required. Browser-bucket sub-classification — anything that looks like a browser visit gets split into four kinds based on the Sec-Fetch-Site, Sec-Fetch-User, and Sec-CH-UA request headers a real browser sends: verified user (top-level navigation triggered by a click or address-bar Enter in a recognised browser), headed agent (real Chromium driven programmatically — Playwright, Puppeteer, Selenium), script agent (bare HTTP client imitating a browser UA — requests, httpx, LangChain, custom agents), spoofer (UA shape that no real browser would emit, like modern Chrome with a non-reduced UA). Visible as a stacked-bar breakdown on the User-Agents subpage so you can see at a glance how much of your “human” traffic is actually automation, and rendered inline as colour-coded slugs on every browser-bucket row in the Recent Activity table on the Analytics page. Detection is server-side fingerprinting of the request itself — no cookies, no JS, no IP. Discoverability Link: rel="alternate"; type="text/markdown" HTTP header on every HTML page tag in for HTML-based discovery Allow: /*.md$ directive in robots.txt CORS Access-Control-Allow-Origin: * on .md and /llms.txt so browser-based AI clients can fetch them Operations Transient caching with automatic invalidation on save_post, on ACF field value saves, on any ACF field group change, and on plugin settings save “Clear cache” button in the settings page Admin notice on fallback HTTP fetch failures “Settings” link next to the plugin row in Plugins screen “View .md” row action in the Posts and Pages list tables Developer hooks ovls_markdown filter for the final Markdown output ovls_frontmatter filter for adding, removing, or modifying frontmatter fields ovls_content_queries filter for the HTML extraction XPath cascade How it works Each request to /about.md is captured by a WordPress rewrite rule and routed through the plugin’s content generator. The generator runs the post through apply_filters( 'the_content', ... ) — the same pipeline WordPress uses on the front end — so Classic Editor, Gutenberg, and shortcodes all work without separate code paths. The rendered HTML is converted to Markdown via league/html-to-markdown, then cached in a WordPress transient. The cache is invalidated automatically on save_post, on ACF field/group changes, and whenever plugin settings are saved. A manual Clear cache button is also available on the settings page. Access methods There are three equivalent ways to request the Markdown version of a page: .md extension — https://example.com/about.md ?format=markdown query — https://example.com/about/?format=markdown Link: rel="alternate" header — returned by every HTML page The .md URL is the recommended canonical form. ACF integration When Advanced Custom Fields is active, ACF field rendering is opt-in at two levels: Site defaults per post type — at Settings → One-V LLM Serve → ACF Defaults, tick fields that should be appended to every post of a given post type. Per-post override — the One-V LLM Serve metabox on each post editor lists every supported ACF field applicable to that post. Tick fields to replace the site defaults for that one post. Supported ACF types: text, textarea, wysiwyg, url, email, link. Each selected field is rendered under a ## Field Label heading. Empty fields are skipped. Disclaimer This plugin is provided “as is”, without warranty of any kind, express or implied, in accordance with the GNU General Public License v2 or later. The authors and contributors are not liable for any direct, indirect, incidental, special, or consequential damages — including but not limited to data loss, lost profits, business interruption, search-ranking changes, or third-party claims — arising from the use of, or inability to use, this software, even if advised of the possibility of such damages. By installing and activating the plugin you acknowledge that: You are responsible for testing the plugin in a staging environment before deploying to production. You are responsible for the content this plugin exposes as Markdown — .md URLs and /llms.txt serve the same content as their HTML counterparts and are intended to be crawled and consumed by AI systems and third-party LLMs. The plugin does not transmit data to any external service. All Markdown generation, caching, and file writes happen on your own server. Nothing in this disclaimer is intended to exclude or limit liability for matters that cannot lawfully be excluded under the consumer-protection laws of your jurisdiction. For the full legal terms see the GPLv2 license at https://www.gnu.org/licenses/gpl-2.0.html.