In short
A Markdown version of a page is the same content, stripped of the HTML template (menus, scripts, styles), served with the text/markdown type. Two methods coexist: a dedicated URL (/guide/index.md) announced by a rel="alternate" link, or content negotiation, which returns Markdown at the usual URL when the request contains Accept: text/markdown. The practice is experimental: it serves agents that read your pages on demand, not ranking. Once this check is done, you know whether it is worth the effort for your site and, if so, every page concerned has its Markdown version, identical to the HTML and declaring it as canonical.
Why it matters
An agent reading an HTML page has to extract the useful text from among the navigation, scripts and footers. A Markdown version gives it the headings, lists, tables and code blocks directly, in far fewer tokens (the units of text the model processes). For technical documentation, the difference shows in the accuracy of a coding assistant's answers and in the cost of reading.
Version 2 of the llms.txt proposal, published in August 2026, makes it a central piece: every page useful to agents should have a Markdown version at the same address followed by .md (or index.md for a URL without a file name), announced by a rel="alternate" type="text/markdown" link, in the HTML or in an HTTP Link header. Large documentation sites already do this: as of November 25, 2026, those of Stripe, Anthropic, Cloudflare, Vercel, GitBook and Next.js respond in Markdown at a .md URL, and several of them (Stripe, Cloudflare, Vercel) also to the Accept: text/markdown header.
On the search engine side, nothing is required: Google states that no machine-readable file or AI text file is needed to appear in its AI features. Markdown versions therefore replace neither the indexing of the HTML nor its quality.
They also carry risks:
- Duplicate content: a
.mdURL indexed by a search engine competes with the HTML page. - Cache poisoning: with negotiation, a cache that ignores the
Acceptheader may serve Markdown to a browser. - Divergence: Markdown generated separately may say something different from the page. Serving crawlers different content from what visitors see is cloaking, a practice to avoid.
What it improves
- Reading by agents Cleaner, shorter text for assistants that read a page at a user's request.
- Token cost Often a large reduction for pages with a heavy template; Cloudflare estimates it page by page in its statistics.
- Consistency with llms.txt The file's links can point to Markdown pages, as the proposal recommends.
- Citations in AI answers No demonstrated effect. No practice guarantees a citation or a recommendation.
- Ranking in Google or Bing No effect, provided the Markdown versions are not indexed as duplicates.
How to check
1. Does a .md URL exist?
curl -s -o /dev/null -D - https://example.com/guide/index.md | grep -i -E "^HTTP|content-type|^link|^vary"
Compliant result: 200, content-type: text/markdown; charset=utf-8, and a link header designating the HTML page as canonical.
2. Does negotiation work without breaking the HTML?
curl -s -o /dev/null -w "%{http_code} %{content_type}\n" -H "Accept: text/markdown" https://example.com/guide/
curl -s -o /dev/null -w "%{http_code} %{content_type}\n" -H "Accept: text/html" https://example.com/guide/
curl -s -o /dev/null -D - https://example.com/guide/ | grep -i "^vary"
Expected: text/markdown for the first request, text/html for the second, and Vary containing Accept. If the second request returns Markdown, a cache is serving the wrong version: stop everything before going further.
3. Does the HTML page announce its Markdown version?
curl -s https://example.com/guide/ | grep -o '<link[^>]*text/markdown[^>]*>'
4. Is the content identical? Compare the headings of the two versions:
curl -s https://example.com/guide/index.md | grep -E '^#{1,3} '
curl -s https://example.com/guide/ | grep -o -E '<h[1-3][^>]*>[^<]+' | sed -E 's/<[^>]+>//'
How to implement
Before you start
First decide whether it is useful.
| Type of site | Benefit | Why |
|---|---|---|
| Technical documentation, API, SDK | high | coding assistants read these pages on demand |
| SaaS knowledge base, pricing and terms pages | medium | stable reference pages, often asked about to assistants |
| Online shop | low to medium | useful product pages, but prices and stock change quickly |
| Blog, brochure site | low | clean HTML is enough, see inspect the initial HTML (opens in a new tab) |
Then choose the method.
| Method | Advantages | Limits |
|---|---|---|
| Conversion by the CDN (Cloudflare) | nothing to develop | paid plan, automatic conversion not reviewed |
Static .md URLs generated at build time |
simple, safe to cache | one more URL per page |
Accept: text/markdown negotiation |
a single URL per piece of content | requires Vary: Accept and a cache that respects it |
Four rules apply everywhere:
- Same content as the HTML page, generated from the same source.
- Canonical pointing to the HTML: a
Link: <https://example.com/guide/>; rel="canonical"header on every Markdown response. Vary: Accepton negotiated URLs, for both HTML and Markdown.- Announcement in the
<head>of the HTML page:
<link rel="alternate" type="text/markdown" href="https://example.com/guide/index.md">
Then list these URLs in your llms.txt: see list the main pages (opens in a new tab).
Cloudflare
Versions Cloudflare dashboard, Pro, Business and Enterprise plans, November 2026.
The Markdown for Agents feature converts the origin's HTML into Markdown when the request contains Accept: text/markdown. It comes at no extra cost on these plans.
- Open
Agent Readiness > Markdown for Agents. - Turn on
Serve Markdown to AI agents. - To limit conversion to part of the site, create a configuration rule instead (
Rules > Configuration Rules) with an expression such ashttp.host eq "docs.example.com"and the Markdown for Agents setting set toOn.
Test:
curl -s -H "Accept: text/markdown" https://example.com/guide/ | head -30
What to know before turning it on:
- The converted response carries
Vary: Acceptand keeps the security and cache headers, but losesETagandLast-Modified: conditional requests are no longer honored. - Conversion stops at 6 MiB of uncompressed HTML; beyond that, the text is truncated.
- By default, the response carries
Content-Signal: ai-train=yes, search=yes, ai-input=yes, unless the origin sends its owncontent-signalheader. Align it with your training policy (opens in a new tab). - The
Analyticstab on the same page shows the converted pages, the requesting user agents and the failures.
Good to know: the conversion is automatic. Check a few pages: content hidden by CSS in the HTML appears in plain text in the Markdown.
Vercel
Versions Vercel platform, all plans, November 2026.
Vercel serves its own documentation in Markdown through negotiation and .md URLs. For your site, apply the Next.js method below, or the @vercel/agent-readability package that Vercel offers for negotiation that respects the weights in the Accept header (Next.js, SvelteKit and Nuxt adapters). Once live, the AI Traffic tab in the project's observability lists the paths that AI crawlers request in Markdown.
Next.js
Versions Next.js 15 and 16 (App Router).
This setup serves content/docs/guide.md as Markdown when an agent requests /docs/guide with Accept: text/markdown, and at the URL /md/docs/guide. Create app/md/[...slug]/route.ts:
import { readFile } from 'node:fs/promises';
import path from 'node:path';
export async function GET(
_request: Request,
{ params }: { params: Promise<{ slug: string[] }> },
) {
const { slug } = await params;
if (slug.some((segment) => segment.startsWith('.'))) {
return new Response('Not found', { status: 404 });
}
const pagePath = `/${slug.join('/')}`;
const file = path.join(process.cwd(), 'content', ...slug) + '.md';
try {
const markdown = await readFile(file, 'utf8');
return new Response(markdown, {
headers: {
'Content-Type': 'text/markdown; charset=utf-8',
Link: `<https://example.com${pagePath}>; rel="canonical"`,
Vary: 'Accept',
},
});
} catch {
return new Response('Not found', { status: 404 });
}
}
Then, in next.config.ts, rewrite the requests that ask for Markdown and add Vary: Accept to the HTML pages:
import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
async rewrites() {
return {
beforeFiles: [
{
source: '/docs/:path*',
has: [{ type: 'header', key: 'accept', value: '(.*)text/markdown(.*)' }],
destination: '/md/docs/:path*',
},
],
};
},
async headers() {
return [
{
source: '/docs/:path*',
headers: [{ key: 'Vary', value: 'Accept' }],
},
];
},
};
export default nextConfig;
The beforeFiles rule takes precedence over the HTML page at the same path. It ignores weights (q=): a request that mentions text/markdown, even as a second choice, receives Markdown. Add the rel="alternate" link to /md/docs/… in generateMetadata, with alternates: { types: { 'text/markdown': … } }.
Apache
Versions Apache 2.4.
For a static site whose build produces an index.md next to each index.html. In the .htaccess file at the root:
AddType text/markdown .md
AddCharset utf-8 .md
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:Accept} text/markdown [NC]
RewriteCond %{DOCUMENT_ROOT}/$1index.md -f
RewriteRule ^(.*/)?$ /$1index.md [L]
RewriteRule ^(.*/)?index\.md$ - [E=MD_PAGE:/$1]
</IfModule>
<IfModule mod_headers.c>
Header set Link "<https://example.com%{MD_PAGE}e>; rel=\"canonical\"" env=MD_PAGE
<FilesMatch "\.(html|md)$">
Header merge Vary Accept
</FilesMatch>
</IfModule>
The first rewrite block serves index.md to requests asking for Markdown, if it exists; otherwise the HTML goes out as usual. The second stores the URL of the HTML page for the canonical header. Check with the commands from the “How to check” section.
Nginx
Versions Nginx 1.24 and later.
Same principle. Place the two map blocks in the http context (for example /etc/nginx/conf.d/markdown.conf):
map $http_accept $wants_markdown {
default 0;
"~*text/markdown" 1;
}
map $uri $markdown_page {
default "";
"~^(.*/)index\.md$" $1;
}
Then, in the site's server block:
location / {
if ($wants_markdown) {
rewrite ^(.*/)$ $1index.md last;
}
add_header Vary Accept always;
try_files $uri $uri/ =404;
}
location ~ /index\.md$ {
types { }
default_type "text/markdown; charset=utf-8";
add_header Vary Accept always;
add_header Link "<https://example.com$markdown_page>; rel=\"canonical\"" always;
try_files $uri =404;
}
An add_header in a location block cancels those at the server level: copy your security headers into it. Reload: sudo nginx -t && sudo systemctl reload nginx.
Laravel
Versions Laravel 12 and 13.
If your content is stored as Markdown, serve it as is. In routes/web.php:
use App\Http\Controllers\GuideMarkdownController;
use App\Http\Controllers\GuidesController;
Route::get('/guides/{slug}.md', GuideMarkdownController::class);
Route::get('/guides/{slug}', [GuidesController::class, 'show'])->name('guides.show');
app/Http/Controllers/GuideMarkdownController.php:
<?php
namespace App\Http\Controllers;
use App\Models\Guide;
use Illuminate\Http\Response;
class GuideMarkdownController
{
public function __invoke(string $slug): Response
{
$guide = Guide::query()
->where('slug', $slug)
->where('is_published', true)
->firstOrFail();
$canonical = route('guides.show', $guide->slug);
return response($guide->body_markdown, 200, [
'Content-Type' => 'text/markdown; charset=utf-8',
'Link' => "<{$canonical}>; rel=\"canonical\"",
'Vary' => 'Accept',
]);
}
}
For negotiation at the usual URL, in GuidesController::show:
if ($request->wantsMarkdown()) {
return app(GuideMarkdownController::class)($slug);
}
return response()
->view('guides.show', ['guide' => $guide])
->header('Vary', 'Accept');
wantsMarkdown() returns true only if text/markdown is the request's preferred type: a browser, which announces text/html, always receives the HTML. If your version of Laravel does not offer it yet, use $request->prefers(['text/html', 'text/markdown']) === 'text/markdown'. Do not use acceptsMarkdown() or accepts(), which return true as soon as the header contains */*. If your content is in HTML, a library such as league/html-to-markdown converts it; review the result.
Documentation platforms
- Mintlify: the links in
llms.txtpoint to.mdpages, and every HTML page announces its Markdown version with arel="alternate"header. Nothing to configure. - GitBook: add
.mdto the URL of any published page;/.mdfor the site's home page. - Docusaurus with
docusaurus-plugin-llms: thegenerateMarkdownFiles: trueoption (off by default) creates one.mdfile per page and links them fromllms.txt. - VitePress with
vitepress-plugin-llms: thegenerateLLMFriendlyDocsForEachPageoption is on by default.
WordPress
Versions WordPress 6.6 and later.
WordPress does not produce a Markdown version of pages. The safest route is conversion by Cloudflare (section above), which does not touch the site. Plugins that add .md URLs evolve quickly: test them on staging with the four checks from “How to check”, especially that the HTML does not regress behind your caching plugin.
Shopify
Versions Shopify platform, all plans, November 2026.
Shopify offers no setting to serve Markdown versions of store pages. Focus the effort on readable HTML and complete product structured data.
Common mistakes
- Forgetting
Vary: Accept: a cache then serves Markdown to browsers, or HTML to agents. - Enabling negotiation behind a CDN that ignores
Acceptin its cache key, on cached HTML pages: the same effect, only worse. - Leaving
.mdURLs without a canonical: they can be indexed as duplicates of the HTML pages. - Generating the Markdown from a different source than the page: the two versions diverge, and serving different content to crawlers amounts to cloaking.
- Returning 200 with an HTML error page for a missing
.mdURL: return a real 404. - Converting everything without reviewing it: tables, tabs and interactive components sometimes convert poorly to Markdown.
Frequently asked questions
Should you create Markdown versions of your pages for GEO?
Markdown versions are mainly useful for technical documentation or reference pages that assistants read at a user's request. No generative engine documents that they improve citation, and Google states that no AI-specific file is needed for its AI features. For a blog or a brochure site, clean HTML that is accessible without JavaScript is enough; save the effort for pages that agents actually consult.
.md URLs or content negotiation: which should you choose?
Choose .md URLs if your site is static or cached by a CDN: each version has its own address, with no risk of mixing them up in caches. Choose content negotiation, with the Accept: text/markdown header, if you want a single URL per piece of content and your cache respects the Vary: Accept header. Many documentation sites offer both, and the llms.txt proposal describes .md URLs.
Do Markdown versions create duplicate content in Google?
Markdown versions can create duplicate content if their .md URLs are crawled and indexed. Add to every Markdown response an HTTP Link header that designates the HTML page as canonical, a mechanism Google supports for non-HTML documents. With content negotiation, the risk is lower, because Googlebot requests HTML and receives the normal page at the same address.
Is Cloudflare Markdown for Agents available on the free plan?
No, Cloudflare's Markdown for Agents is reserved for the Pro, Business and Enterprise plans, at no extra cost on those plans. The feature converts the origin's HTML into Markdown for requests that contain the Accept: text/markdown header. It is turned on in the domain's Agent Readiness section or through a configuration rule limited to a subdomain or a path.
Resources
- llmstxt.org: the llms.txt proposal, version 2 and changesllmstxt.org
- Cloudflare: Markdown for Agentsdevelopers.cloudflare.com
- Vercel: Markdown and agent discoveryvercel.com
- Next.js: rewritesnextjs.org
- Laravel: HTTP requests and content negotiationlaravel.com
- Google Search Central: consolidate duplicate URLsdevelopers.google.com
- MDN: Vary headerdeveloper.mozilla.org
Updated on
Topic checklist (PDF)