What is Cloudflare Markdown for Agents and why it changes the rules of AI optimization
The way users and systems move around the internet is going through the biggest change in a decade. Traffic from traditional search engines is starting to be complemented, and in some segments even replaced, by traffic from AI agents and large language models (LLMs). The problem is that today’s web was built for people, not for artificial intelligence.
While a person easily ignores the visual noise on a page (menus, footers, banner ads), HTML code is a huge burden for an AI bot. That’s why in February 2026 Cloudflare introduced a new feature, Markdown for Agents, which solves this problem directly at the network infrastructure level and shows where technical SEO is heading.
How automatic conversion to Markdown works
Markdown is a simple markup language that has become the unofficial standard for communicating with AI. It keeps the logical structure of the text (headings, lists, tables) but strips out all the complex HTML code, CSS classes and scripts.
Cloudflare’s feature is based on content negotiation.
- When a regular user visits the website in a browser, the server delivers the standard HTML page as usual.
- But if an AI agent (such as Claude Code or OpenAI’s search bot) visits the website and states in the HTTP header of its request that it prefers the Accept: text/markdown format, Cloudflare steps in.
- The Cloudflare network (CDN) fetches the original HTML from your server, converts it to clean Markdown in real time in the background and sends this lightweight version to the bot.
Here’s a diagram of exactly how Markdown for AI agents works:

Your origin server (your web hosting) keeps working as before, and you don’t have to build any complicated parallel versions of your pages.
How to turn on Markdown for AI agents
To enable Markdown for Agents in the dashboard, follow these steps:
- Log in to the Cloudflare dashboard ↗ and select your account (you need the Pro or Business plan to activate it).
- Select the zone you want to configure.
- Go to the AI Crawl Control ↗ section.
- Enable the Markdown for Agents feature.
Why Markdown is key for AI
This technical change has three major effects on how efficiently AI can process the content of your website.
1. Massive token savings (up to 80%)
AI doesn’t read text word by word but in tokens. Processing every token costs computing power and money. According to Cloudflare, an average article in HTML uses over 16,000 tokens because of invisible code (`<div>`, `<script>`, `<nav>`). The same article converted to Markdown uses only around 3,000 tokens.
To get a better idea, take a look at how the same content, a simple heading and one paragraph, looks in both formats:
Classic HTML code (full of structural noise):
HTML
<div class="content-wrapper pb-8">
<section id="o-nas" class="section-container">
<h2 class="section-title text-xl font-bold mt-4">About us</h2>
<div class="text-block text-gray-700">
<p class="paragraph-text mb-4">
We are an expert team focused on /web-at-peace" class="link-primary">website development</a> and SEO.
</p>
</div>
</section>
</div>Clean Markdown (semantics and content only):
Markdown
## About us
We are an expert team focused on [website development](/web-na-miru) and SEO.While the HTML version contains dozens of formatting tags (classes for colors, spacing and wrapper containers) that mean absolutely nothing for understanding the text, Markdown passes only clean information and logical structure to the AI model. For language models (LLMs), it’s like the difference between having to read every barcode, recycling symbol and delivery instruction on an envelope and simply reading the letter inside.
2. Size estimate up front
Cloudflare adds a useful x-markdown-tokens header to the response. It tells the bot in advance how long the document is. The agent can then decide right away whether the text fits into its “context window” without having to download and analyze the whole thing.
3. More accurate AI answers
The less code and visual clutter an AI model has to filter out, the lower the chance of a so-called hallucination. Clean, structured text leads to much more accurate and relevant citations of your content in the final answers.
| Parameter | Classic HTML | Clean Markdown |
|---|---|---|
| Primarily intended for | Human readers (rendered in a browser) | Machine processing (AI agents, LLMs) |
| Information noise | Extremely high (scripts, styles, layout) | Minimal (clean content structure only) |
| Token consumption | Very high | Low (reduced by up to 80%) |
A new level of control: Content-Signal headers
With the rise of AI, website owners are rightly worried about their data. Who is downloading their content and what are they using it for? The traditional robots.txt file can only block access; it can’t specify the purpose.
That’s why the Markdown for Agents solution also introduces Content-Signal headers. They work as machine-readable terms of use. The website owner can specify in detail whether the downloaded content may be used for:
- ai-train (training new AI models),
- search (showing in search results),
- ai-input (direct answers to users in chat).
This is a huge step forward for copyright protection and control over your own digital assets.
Is it safe with regard to Google and cloaking?
When the feature was announced, the SEO community started debating whether Google might penalize websites for cloaking (a deceptive technique that shows search engines different content than real users). Google’s John Mueller has said in the past that building parallel websites just for bots is a “stupid idea.”
Cloudflare, however, doesn’t rely on risky bot detection (User-Agent sniffing) but on standard HTTP negotiation. The content is identical in terms of information; only its formatting changes, based on an explicit request from the client. Although there is a theoretical risk (for example, a conversion error that hides important text), technically this is a legitimate optimization of data flow that can significantly improve how readable your website is for AI models. And just like with Google, the more readable a website is for language models, the more likely it is to be visible.
How to prepare your website for AI agents (even without Cloudflare)
Even if your website doesn’t run on Cloudflare’s infrastructure (or on the premium plan where the feature is available), generative engine optimization (GEO) is becoming a must. You can apply the basic principles right away:
- Implement advanced structured data (JSON-LD): Mark up articles, FAQ sections and products so that machines understand the context precisely.
- Adopt the /llms.txt standard: This is an emerging convention that works similarly to robots.txt, but specifically for language models. Placed in the root directory, the file gives AI agents a simplified, plain-text map of your website’s content and context, which makes it much easier for them to find their way around and extract key information.
- Rethink your content structure: Use a clear heading hierarchy and put a short, punchy answer at the start of every important section (the answer-first approach) that AI can easily pick up.
- Let AI bots in: Check that your robots.txt file doesn’t needlessly block modern search bots such as OAI-SearchBot, which builds the index for ChatGPT.
Markdown for Agents is just one piece of the puzzle; the other is whether you let AI bots onto your website at all. Since September 15, 2026, Cloudflare has been blocking AI training bots by default on new and free websites, and this change can unintentionally hit traditional search bots too. When to keep the setting and when to change it is covered in our article on AI bots on your website.



