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%
Worddown
Worddown is a powerful WordPress plugin that enables you to export your pages and posts to markdown files, making them perfect for integration with AI chatbots and other markdown-based systems. Key Features Export pages and posts to markdown files Support for custom page builders (ACF Flexible Content, Elementor, Divi classic shortcodes, etc.) REST API endpoints for programmatic access WP-CLI commands for automation Multilingual support Background export mode for large sites Customizable HTML content filters Adapters When a supported page builder is installed, enable it under Settings → Adapters: Divi — Classic Builder shortcode layouts ([et_pb_*], Divi 4 / unmigrated pages). Boots Divi modules during export so shortcodes render to HTML before Markdown conversion. Native Divi 5 block layouts ( ) use the standard WordPress content pipeline and do not need this adapter. Modularity — Injects Modularity modules around main content when available. Export Methods WordPress Admin Dashboard WP-CLI Commands REST API Endpoints WP-CLI Support Export your content directly from the command line: wp worddown export For large sites, use background mode: wp worddown export --background REST API Access export functionality programmatically through REST API endpoints: GET /wp-json/worddown/v1/files – List all exported markdown files GET /wp-json/worddown/v1/files/{post_id} – Get specific file content POST /wp-json/worddown/v1/export – Trigger export Custom HTML Content Filters Customize your markdown output using WordPress filters: add_filter('worddown_custom_html_content', function($content, $post_id, $post_type) { if ($post_type === 'page') { $content .= ' My custom HTML for page ' . $post_id . ' '; } return $content; }, 10, 3); Custom Metadata Filter Add or override YAML front matter keys after Worddown assembles core metadata (respecting your Metadata to include settings): add_filter('worddown_custom_metadata', function($meta, $post_id, $context) { $meta['reading_time'] = get_post_meta($post_id, 'reading_time', true); return $meta; }, 10, 3); Parameters: $meta — Front matter array after admin toggles (add keys or overwrite existing ones) $post_id — Post ID being exported $context — Worddown\Export\PostContext with preloaded post data (read-only) Available Translations English Swedish (sv_SE) Development For development instructions and advanced usage, please visit the plugin repository. Build Process The plugin uses Vite for asset compilation. Development requirements: Node.js 16.0 or higher npm 8.0 or higher
Top keywords
- export12×3.28%
- post12×3.28%