Skip to content
    Agent readiness•September 28, 2026

    Markdown for agents: send a markdown version of your pages

    Send a markdown version of your pages to AI agents. This article tells you what GenReady checks, what each result means, and how to add it on six platforms.

    In short

    An AI agent can ask your server for a markdown version of a page. It does this with the HTTP Accept header. When your server sends markdown, the agent reads your content and not your page layout. On Cloudflare, this takes one setting. Mintlify sends markdown by default.

    Why it is important

    An AI agent pays for each token that it reads. Most of an HTML page is navigation, scripts and layout. In October 2026, we tested pages on Cloudflare, Vercel, Mintlify and genready.ai. The markdown version was 84% to 99% smaller than the HTML. The agent also gets less noise, so it is less likely to quote your cookie banner.

    A detected markdown version adds +1 to your GenReady score. Not all AI agents ask for markdown. Claude Code and OpenCode send an Accept header that asks for markdown. We found no source that shows OpenAI or Perplexity agents send it.

    What GenReady checks

    GenReady requests your page again with this Accept header:

    text/markdown, text/html;q=0.9, */*;q=0.8

    The check passes when all of these are true:

    • The status is 2xx.
    • The Content-Type header is text/markdown.
    • The body is markdown. It has at least 50 characters that are not spaces, and it does not start with an HTML document tag such as <html>.

    If your server sends HTML, GenReady looks for a .md link on the page or in the Link header. A .md link is <link rel="alternate" type="text/markdown" href="...">. If that URL sends markdown, the check also passes.

    A markdown response without Vary: Accept passes with a warning. In a site scan, GenReady also shows how many of your pages send markdown.

    What your result means

    ResultWhat it meansWhat to do
    Not served: HTMLYour server sent HTML for the markdown request.Find your platform in the platform guides below.
    Not served: wrong Content-TypeThe Content-Type header is not text/markdown.Set Content-Type: text/markdown; charset=utf-8. Do not use text/x-markdown or text/plain.
    Not served: HTML as markdownThe header says text/markdown, but the body starts with HTML.Convert the main content to markdown before you send it.
    Not served: empty bodyThe body has fewer than 50 characters that are not spaces.Send the full main content of the page.
    Not served: error statusYour server sent an error status, for example 404 or 406.Make the rule for the Accept header send status 200.
    Served via .md linkThe page links to a working markdown version. This passes.Also send the markdown version at the page URL. Then agents do not have to find the link first.
    Not served: .md link does not workThe page has a .md link, but that URL does not send markdown.Repair the URL, or remove the .md link from the page.
    Served as markdown, Vary header missingYour server sends markdown without Vary: Accept. This passes with a warning.Add Vary: Accept to the markdown response and to the HTML response.
    Check failedWe could not do the check. The server did not reply in 3 seconds, the connection failed, or a redirect went to a private address.Do a check that the page opens from a public network. Then scan the page again.

    For your developer

    Warning: Without Vary: Accept, a CDN or page cache can store one version and send it to everyone. People can then get markdown, or agents can get HTML.

    1. Read the Accept header of each GET request.
    2. Send markdown when the q value of text/markdown is equal to or higher than the q value of text/html.
    3. Treat equal q values as a request for markdown. Some agents send text/markdown, text/html, */*.
    4. Send status 200 and Content-Type: text/markdown; charset=utf-8.
    5. Send the main content only: the title, headings, text, lists, tables and links.
    6. Add Vary: Accept to the markdown response and to the HTML response.

    Convert your content to markdown when you publish it, and store the result. Conversion on each request also works, but it uses CPU for each agent visit.

    Platform guides

    Find your platform below. Each guide shows the date of our last check of the vendor documentation.

    Cloudflare

    Cloudflare can convert your HTML pages to markdown at its edge. You do not have to change your server. The Cloudflare feature is named Markdown for Agents. It is available on the Pro, Business and Enterprise plans.

    Warning: If your server sends no Content-Signal header, Cloudflare adds ai-train=yes, search=yes, ai-input=yes to the markdown response. Set your own Content-Signal first if you do not want AI training. See AI usage preferences.

    1. In the Cloudflare dashboard, select your account and your zone.
    2. Open AI Crawl Control.
    3. Turn on the Cloudflare setting Markdown for Agents.
    4. To use it on some paths only, add a Configuration Rule with the Cloudflare setting Markdown for Agents.

    Cloudflare adds Vary: Accept and the token headers x-markdown-tokens and x-original-tokens. It converts HTML responses up to 2 MB.

    Source: Cloudflare documentation. Checked: 2026-10-05.

    Vercel and Next.js

    Vercel recommends a rewrite in next.config.ts. The rewrite sends requests with text/markdown in the Accept header to a route that returns markdown.

    1. Create a route handler that returns the markdown version of a page with Content-Type: text/markdown.
    2. Add a rewrite with a has condition on the accept header, in beforeFiles.
    3. Add Vary: Accept to the markdown response in the route handler. The Vercel examples do not set it.
    4. Add Vary: Accept to the HTML response with a headers() rule in next.config.ts.
    5. Deploy, and test the page with curl.
    // next.config.ts
    import type { NextConfig } from 'next';
    
    const nextConfig: NextConfig = {
      rewrites() {
        return {
          beforeFiles: [
            {
              source: '/docs/:path*',
              has: [{ type: 'header', key: 'accept', value: '(.*)text/markdown(.*)' }],
              destination: '/docs/:path*.md',
            },
          ],
        };
      },
    };
    
    export default nextConfig;

    Source: Vercel guide and Vercel blog. Checked: 2026-10-05.

    Netlify

    We found no Netlify setting for this. Use an Edge Function that reads the Accept header. Your build must also write a markdown version of each page, for example index.md next to index.html.

    Warning: The Edge Function runs only for markdown requests, so your HTML responses do not get Vary: Accept from it. Add Vary: Accept to your HTML files with a [[headers]] rule in netlify.toml. Netlify custom headers do not apply to Edge Function responses.

    1. Make your build write a markdown version of each page next to its HTML file.
    2. Create the file netlify/edge-functions/markdown.ts.
    3. In its config, set header: { accept: 'text/markdown' }. The function then runs only for markdown requests.
    4. In the function, return the markdown version with Content-Type: text/markdown and Vary: Accept.
    5. If a page has no markdown version, return nothing. Netlify then sends the HTML.

    Source: guide by Kitty Giraudel and the Netlify Edge Functions documentation. Netlify has no guide for this. Checked: 2026-10-05.

    WordPress

    WordPress needs a plugin for this. The plugins are new, and most have fewer than 1,000 active installs. Two examples that had updates in 2026:

    • Mescio for Agents, in the WordPress.org directory. When it finds LiteSpeed Cache or WP Rocket, it does not send markdown at the page URL. It then uses a separate REST URL.
    • Post Content to Markdown by Roots, installed with Composer. An open issue reports that it sends HTML for text/markdown, text/html, */*.

    Warning: Some page caches ignore Vary: Accept, for example LiteSpeed Cache, WP Rocket and Cloudflare APO. They can then send the markdown version to people. Open your pages in a browser after you install the plugin.

    1. Install and activate the plugin.
    2. Clear your page cache.
    3. Test a post with curl.
    4. Open the same post in a browser, and do a check that you get the normal page.

    We did not test these plugins on a live site. Source: the plugin pages above. Checked: 2026-10-05.

    Documentation platforms

    Some documentation platforms send markdown by default. Do a check of your platform before you change anything.

    • Mintlify sends markdown for the Accept header, and at each page URL with .md added. You do not have to configure it.
    • GitBook supports the Accept header and .md URLs.
    • Fern supports the Accept header and .md URLs.
    • Docusaurus has no content negotiation. A plugin can make .md files. Then add a rule on your host, as in the Vercel or Netlify guide.

    Source: Mintlify, GitBook and Fern documentation. Checked: 2026-10-05.

    Any server

    On your own server, the rule is the same everywhere. Read the Accept header. If it prefers text/markdown, send the markdown version. Always send Vary: Accept.

    This Express example sends a stored markdown file for each docs page:

    import express from 'express';
    import { readFile } from 'node:fs/promises';
    import path from 'node:path';
    
    const app = express();
    
    app.use((req, res, next) => {
      res.vary('Accept');
      next();
    });
    
    app.get('/docs/:slug', async (req, res, next) => {
      if (req.accepts(['text/html', 'text/markdown']) !== 'text/markdown') return next();
      if (!/^[a-z0-9-]+$/.test(req.params.slug)) return next();
      try {
        const md = await readFile(path.join('content', 'docs', `${req.params.slug}.md`), 'utf8');
        res.type('text/markdown; charset=utf-8').send(md);
      } catch {
        next(); // no markdown version: send the HTML page
      }
    });

    We tested this example with Express 4. It sends markdown for text/markdown, text/html, */*. It sends HTML for the Accept header of a browser.

    On Nginx, use a map on $http_accept to select a .md file. Add add_header Vary Accept always, and add text/markdown md to types. A map on the header text also matches text/markdown;q=0. We did not test an Nginx configuration.

    Source: Express documentation. Checked: 2026-10-05.

    Test it yourself

    Run this command. Replace the URL with one of your pages.

    curl -s -D - -o /dev/null -H "Accept: text/markdown, text/html;q=0.9, */*;q=0.8" https://yoursite.com/page

    Look for content-type: text/markdown and vary: Accept in the output. Then run the command without the Accept header. You must get text/html.

    Use a GET request, as in this command. Some servers send markdown only for GET, so curl -I can show HTML.

    genready.ai sends markdown for its home page, help center and blog. Try curl -H "Accept: text/markdown" https://genready.ai/help.

    Markdown for agents and llms.txt

    llms.txt and markdown negotiation work together. llms.txt is a list of the important pages on your site, and its links can point to markdown versions. Markdown negotiation sends the markdown version at the normal page URL. See the llms.txt article.

    Was this article helpful?