# Evaluate Markdown versions

- Check 39.09 · llms.txt and AI formats (experimental) · Experimental
- Source: https://checklist-seo-geo.com/en/llmstxt-ai-formats-experimental/evaluate-markdown-versions
- Decide whether to serve your pages as Markdown to AI agents, then set it up: .md URLs, Accept negotiation, Cloudflare, Next.js, Apache, Nginx.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/llmstxt-ai-formats-experimental/evaluate-markdown-versions.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## 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 `.md` URL indexed by a search engine competes with the HTML page.
- **Cache poisoning**: with negotiation, a cache that ignores the `Accept` header 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?**

```bash
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?**

```bash
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?**

```bash
curl -s https://example.com/guide/ | grep -o '<link[^>]*text/markdown[^>]*>'
```

**4. Is the content identical?** Compare the headings of the two versions:

```bash
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](https://checklist-seo-geo.com/en/javascript-html-rendering/inspect-initial-html) |

**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:

1. **Same content** as the HTML page, generated from the same source.
2. **Canonical pointing to the HTML**: a `Link: <https://example.com/guide/>; rel="canonical"` header on every Markdown response.
3. **`Vary: Accept`** on negotiated URLs, for both HTML and Markdown.
4. **Announcement** in the `<head>` of the HTML page:

```html
<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](https://checklist-seo-geo.com/en/llmstxt-ai-formats-experimental/list-main-pages).

### 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.

1. Open [`Agent Readiness > Markdown for Agents`](https://dash.cloudflare.com/?to=/:account/:zone/agent-readiness/markdown-for-agents).
2. Turn on `Serve Markdown to AI agents`.
3. To limit conversion to part of the site, create a configuration rule instead (`Rules > Configuration Rules`) with an expression such as `http.host eq "docs.example.com"` and the Markdown for Agents setting set to `On`.

Test:

```bash
curl -s -H "Accept: text/markdown" https://example.com/guide/ | head -30
```

What to know before turning it on:

- The converted response carries `Vary: Accept` and keeps the security and cache headers, but loses `ETag` and `Last-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 own `content-signal` header. Align it with your [training policy](https://checklist-seo-geo.com/en/ai-crawler-access-data-policy/define-rules-search-training-user-triggered-access).
- The `Analytics` tab 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`:

```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:

```ts
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:

```apache
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`):

```nginx
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:

```nginx
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`:

```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
<?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`:

```php
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.txt` point to `.md` pages, and every HTML page announces its Markdown version with a `rel="alternate"` header. Nothing to configure.
- **GitBook**: add `.md` to the URL of any published page; `/.md` for the site's home page.
- **Docusaurus** with `docusaurus-plugin-llms`: the `generateMarkdownFiles: true` option (off by default) creates one `.md` file per page and links them from `llms.txt`.
- **VitePress** with `vitepress-plugin-llms`: the `generateLLMFriendlyDocsForEachPage` option 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 `Accept`** in its cache key, on cached HTML pages: the same effect, only worse.
- **Leaving `.md` URLs 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 `.md` URL: 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](https://llmstxt.org/) and [changes](https://llmstxt.org/changes.html)
- [Cloudflare: Markdown for Agents](https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/)
- [Vercel: Markdown and agent discovery](https://vercel.com/docs/agent-resources/markdown-access)
- [Next.js: rewrites](https://nextjs.org/docs/app/api-reference/config/next-config-js/rewrites)
- [Laravel: HTTP requests and content negotiation](https://laravel.com/docs/13.x/requests#content-negotiation)
- [Google Search Central: consolidate duplicate URLs](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls)
- [MDN: Vary header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Vary)

Next steps: [check whether the targeted systems read these files](https://checklist-seo-geo.com/en/llmstxt-ai-formats-experimental/check-whether-targeted-systems-read-these-files) and [evaluate llms-full.txt for documentation](https://checklist-seo-geo.com/en/llmstxt-ai-formats-experimental/evaluate-llms-fulltxt-documentation).
