{"id":283550,"date":"2026-03-09T01:33:45","date_gmt":"2026-03-09T01:33:45","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/markdown-for-ai-agents\/"},"modified":"2026-03-09T01:32:51","modified_gmt":"2026-03-09T01:32:51","slug":"markdown-for-ai-agents","status":"publish","type":"plugin","link":"https:\/\/fao.wordpress.org\/plugins\/markdown-for-ai-agents\/","author":17731583,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.0","stable_tag":"1.0.0","tested":"6.9.4","requires":"6.9","requires_php":"7.4","requires_plugins":null,"header_name":"Markdown for AI Agents","header_author":"Selvakumar Duraipandian","header_description":"Serve clean Markdown versions of WordPress content to AI agents using HTTP content negotiation.","assets_banners_color":"","last_updated":"2026-03-09 01:32:51","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/github.com\/selvasudar","header_plugin_uri":"","header_author_uri":"https:\/\/github.com\/selvasudar","rating":0,"author_block_rating":0,"active_installs":30,"downloads":208,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"selvasudar","date":"2026-03-09 01:32:51"}},"upgrade_notice":{"1.0.0":"<p>This is the initial release of the plugin. No upgrade notice is applicable at this time.<\/p>"},"ratings":[],"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3477684,"resolution":"1","location":"assets","locale":""}},"screenshots":{"1":"Sample Markdown output returned in a terminal using <code>curl -H \"Accept: text\/markdown\"<\/code> on a WordPress post. The response shows the post title as a top-level Markdown heading, followed by the post body in plain Markdown, with all HTML, navigation, and theme chrome stripped away."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2353,257149,226124,4608,70446],"plugin_category":[],"plugin_contributors":[257330],"plugin_business_model":[],"class_list":["post-283550","plugin","type-plugin","status-publish","hentry","plugin_tags-ai","plugin_tags-content-negotiation","plugin_tags-llm","plugin_tags-markdown","plugin_tags-rag","plugin_contributors-selvasudar","plugin_committers-selvasudar"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/markdown-for-ai-agents.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/markdown-for-ai-agents\/assets\/screenshot-1.png?rev=3477684","caption":"Sample Markdown output returned in a terminal using <code>curl -H \"Accept: text\/markdown\"<\/code> on a WordPress post. The response shows the post title as a top-level Markdown heading, followed by the post body in plain Markdown, with all HTML, navigation, and theme chrome stripped away."}],"raw_content":"<!--section=description-->\n<p>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 <code>Accept: text\/markdown<\/code> header, the plugin intercepts the request and returns a clean, structured Markdown representation of the post or page content.<\/p>\n\n<p>This is ideal for AI crawlers, RAG (Retrieval-Augmented Generation) systems, and non-browser clients that prefer machine-friendly text over complex HTML.<\/p>\n\n<p><strong>Important note:<\/strong> This plugin is primarily a developer\/integration tool. Human visitors browsing your site will never see any difference \u2014 the Markdown output is only served when explicitly requested via the <code>Accept: text\/markdown<\/code> HTTP header. Normal browser requests always receive the standard HTML page.<\/p>\n\n<p><strong>Key Features:<\/strong><\/p>\n\n<ul>\n<li>Automatically detects <code>Accept: text\/markdown<\/code> headers.<\/li>\n<li>Converts HTML content to clean Markdown using the League HTMLToMarkdown library.<\/li>\n<li>Strips away theme layout, navigation, headers, footers, and sidebars \u2014 serving only the main content.<\/li>\n<li>Adds useful HTTP response headers: <code>Content-Type: text\/markdown<\/code>, <code>Vary: Accept<\/code>, and <code>X-Markdown-Word-Count<\/code>.<\/li>\n<li>Respects WordPress visibility rules and filters.<\/li>\n<li>No configuration required \u2014 works out of the box for posts, pages, and custom post types.<\/li>\n<\/ul>\n\n<h3>How It Works<\/h3>\n\n<p>This plugin uses a standard web technique called <strong>HTTP content negotiation<\/strong>. The same URL on your site can serve different representations of the same content depending on what the client asks for:<\/p>\n\n<ul>\n<li>A regular browser sends <code>Accept: text\/html<\/code> \u2192 receives your normal HTML page.<\/li>\n<li>An AI agent sends <code>Accept: text\/markdown<\/code> \u2192 receives a clean Markdown version of the same page.<\/li>\n<\/ul>\n\n<p>No extra URLs, no duplicate content, no configuration needed. The plugin hooks into WordPress's <code>template_redirect<\/code> action, detects the <code>Accept<\/code> header, captures the rendered HTML, converts it to Markdown, and returns it with appropriate headers.<\/p>\n\n<h3>Why Markdown for AI Agents?<\/h3>\n\n<p>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 \u2014 none of which carries meaning for an AI model.<\/p>\n\n<p>Serving clean Markdown instead can reduce token consumption by up to 60%, which means:<\/p>\n\n<ul>\n<li><strong>Lower API costs<\/strong> \u2014 fewer tokens ingested when loading pages into vector stores or LLM pipelines.<\/li>\n<li><strong>Faster processing<\/strong> \u2014 less text for the model to parse, filter, and discard.<\/li>\n<li><strong>Better retrieval accuracy<\/strong> \u2014 higher signal-to-noise ratio improves the quality of RAG results.<\/li>\n<li><strong>Simpler pipelines<\/strong> \u2014 no need for custom HTML stripping logic on the client side; the plugin handles it server-side.<\/li>\n<\/ul>\n\n<p>Any AI agent, crawler, or ingestion script that sends <code>Accept: text\/markdown<\/code> in its request header will automatically receive the clean Markdown version \u2014 no extra URLs, no separate endpoints, no changes to your content workflow.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>markdown-for-ai-agents<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory, or install it directly via the WordPress Plugins screen.<\/li>\n<li>Activate the plugin through the <strong>Plugins<\/strong> menu in WordPress.<\/li>\n<li>The plugin works immediately with no settings to configure.<\/li>\n<\/ol>\n\n<p><strong>Verifying it works \u2014 Option 1: Using curl (recommended for developers)<\/strong><\/p>\n\n<p>Open your terminal and run the following command, replacing the URL with any post or page on your site:<\/p>\n\n<pre><code>curl -H \"Accept: text\/markdown\" https:\/\/your-site.com\/sample-page\/\n<\/code><\/pre>\n\n<p>You should see plain Markdown text returned instead of HTML. For example:<\/p>\n\n<pre><code>curl -H \"Accept: text\/markdown\" https:\/\/your-site.com\/hello-world\/\n<\/code><\/pre>\n\n<p>A successful response will begin with the post title as a Markdown heading (e.g. <code># Hello World<\/code>) followed by the post content in Markdown format, with no HTML tags, navigation, or sidebar content.<\/p>\n\n<p><strong>Verifying it works \u2014 Option 2: Using a browser extension (no terminal required)<\/strong><\/p>\n\n<ol>\n<li>Install the <strong>ModHeader<\/strong> extension for Chrome or Firefox (free, available in their respective extension stores).<\/li>\n<li>Open ModHeader and add a new request header: Name = <code>Accept<\/code>, Value = <code>text\/markdown<\/code>.<\/li>\n<li>Enable the header and visit any post or page on your WordPress site.<\/li>\n<li>Your browser will display the raw Markdown text of that page instead of the styled HTML version.<\/li>\n<li>Disable or remove the header in ModHeader when you are done to return to normal browsing.<\/li>\n<\/ol>\n\n<p><strong>Verifying it works \u2014 Option 3: Using an online HTTP client<\/strong><\/p>\n\n<p>Tools like <a href=\"https:\/\/hoppscotch.io\">Hoppscotch<\/a> (free, browser-based) allow you to make HTTP requests with custom headers without installing anything:<\/p>\n\n<ol>\n<li>Go to https:\/\/hoppscotch.io<\/li>\n<li>Enter any post or page URL from your site.<\/li>\n<li>Under <strong>Headers<\/strong>, add <code>Accept<\/code> = <code>text\/markdown<\/code>.<\/li>\n<li>Click <strong>Send<\/strong> and you will see the Markdown response in the response panel.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"does%20this%20change%20what%20human%20visitors%20see%3F\"><h3>Does this change what human visitors see?<\/h3><\/dt>\n<dd><p>No. Standard browser requests always receive the normal HTML version of your pages. The Markdown output is only served when a client explicitly includes <code>Accept: text\/markdown<\/code> in its HTTP request header. No regular browser sends this header by default.<\/p><\/dd>\n<dt id=\"which%20post%20types%20are%20supported%3F\"><h3>Which post types are supported?<\/h3><\/dt>\n<dd><p>All singular content types are supported: standard Posts, Pages, and any registered Custom Post Types. Archive pages, category pages, and the homepage (if set to a blog feed) are not served as Markdown.<\/p><\/dd>\n<dt id=\"how%20do%20i%20know%20the%20plugin%20is%20working%3F\"><h3>How do I know the plugin is working?<\/h3><\/dt>\n<dd><p>Use any of the three verification methods described in the Installation section above. The quickest check is: <code>curl -H \"Accept: text\/markdown\" https:\/\/your-site.com\/sample-page\/<\/code>. A working response will return plain text starting with your post title as a Markdown <code>#<\/code> heading.<\/p><\/dd>\n<dt id=\"what%20content%20is%20included%20in%20the%20markdown%20output%3F\"><h3>What content is included in the Markdown output?<\/h3><\/dt>\n<dd><p>The Markdown output contains the full rendered post or page content \u2014 the title and body \u2014 converted to Markdown. Navigation menus, sidebars, footers, and <code>&lt;script&gt;<\/code> and <code>&lt;style&gt;<\/code> tags are automatically stripped out to provide a clean, token-efficient result for AI consumption.<\/p><\/dd>\n<dt id=\"what%20http%20headers%20does%20the%20plugin%20send%20with%20the%20markdown%20response%3F\"><h3>What HTTP headers does the plugin send with the Markdown response?<\/h3><\/dt>\n<dd><p>The response includes:<\/p>\n\n<ul>\n<li><code>Content-Type: text\/markdown; charset=utf-8<\/code> \u2014 tells the client the content format.<\/li>\n<li><code>Vary: Accept<\/code> \u2014 informs caches that the response varies based on the Accept header, preventing cached HTML from being served to Markdown clients.<\/li>\n<li><code>X-Markdown-Generator: Markdown for AI Agents<\/code> \u2014 identifies the plugin.<\/li>\n<li><code>X-Markdown-Word-Count: [number]<\/code> \u2014 the word count of the Markdown content.<\/li>\n<\/ul><\/dd>\n<dt id=\"will%20this%20affect%20my%20seo%20or%20page%20caching%3F\"><h3>Will this affect my SEO or page caching?<\/h3><\/dt>\n<dd><p>No. The <code>Vary: Accept<\/code> header is set on Markdown responses so that HTTP caches (including CDNs) correctly cache HTML and Markdown separately. Search engine crawlers do not send <code>Accept: text\/markdown<\/code> headers, so they will always receive and index the normal HTML version of your pages.<\/p><\/dd>\n<dt id=\"does%20the%20plugin%20require%20any%20additional%20libraries%3F\"><h3>Does the plugin require any additional libraries?<\/h3><\/dt>\n<dd><p>The League HTMLToMarkdown library is bundled inside the plugin under <code>includes\/lib\/HtmlToMarkdown\/<\/code>. No additional installation steps are required.<\/p><\/dd>\n<dt id=\"is%20this%20compatible%20with%20page%20builders%20or%20block%20themes%3F\"><h3>Is this compatible with page builders or block themes?<\/h3><\/dt>\n<dd><p>Yes. Because the plugin captures the fully rendered HTML output (after WordPress and any theme or plugin has finished building the page), it works regardless of whether your content is built with the Classic Editor, Gutenberg blocks, Elementor, or any other page builder.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Serve clean Markdown versions of WordPress content to AI agents using HTTP content negotiation.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/283550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=283550"}],"author":[{"embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/selvasudar"}],"wp:attachment":[{"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=283550"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=283550"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=283550"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=283550"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=283550"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=283550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}