All articles
AI agents / July 25, 2026

How to optimize your site for AI search

13 min read
On this page

AI search optimization is the practice of making your content easy for AI answer engines to fetch, parse, and cite, so your brand appears in the responses that ChatGPT, Perplexity, Google AI Overviews, and Gemini give to real questions. Most guides jump straight to content tactics: write entity-rich copy, add expert quotes, structure for extraction. That advice is correct, and it is also the second half of the job. The first half is a plumbing question almost nobody asks out loud. Can the AI crawlers even reach your content, and once they arrive, can they read it?

If the answer is no, every content tactic downstream is wasted effort. An AI engine cannot cite a page it never successfully fetched, and it cannot extract an answer from HTML that renders to an empty shell. This guide fixes the foundation first, then gives you an optimization checklist, then shows you how to measure whether any of it worked. Treat it as a sequence a team can execute in a week, not a philosophy.

Why the technical foundation comes before content

The technical foundation matters first because AI crawlers behave differently from the Googlebot you have optimized for over the last decade. Two facts drive everything below.

First, most standalone AI crawlers do not execute JavaScript. Googlebot renders pages in a headless Chromium and waits for client-side scripts to paint content. The crawlers that feed AI answer engines, by contrast, largely fetch raw HTML and move on. OpenAI’s GPTBot, Anthropic’s ClaudeBot, PerplexityBot, and Common Crawl’s CCBot pull the initial HTML response and parse what is there. If your headline, body copy, and answer live in a React or Vue bundle that only assembles in the browser, those crawlers see an empty container. Your carefully written answer is invisible to the exact systems you are trying to reach.

Second, there is no single “AI crawler.” There are at least three distinct jobs, and they use different user agents:

  • Training crawlers collect text to train future models. GPTBot and CCBot are the common examples. Blocking them affects long-term model knowledge, not live answers.
  • Retrieval crawlers fetch pages in real time to answer a live query using retrieval-augmented generation. OAI-SearchBot and PerplexityBot fall here. These drive the citations you can actually win this quarter.
  • User-triggered fetchers grab a page because a person pasted a link or asked the assistant to read it. ChatGPT-User and Claude-User behave this way.

The distinction is not academic. If you want citations in ChatGPT’s search results, blocking OAI-SearchBot in robots.txt removes you from the running while doing nothing to stop training. Understanding which bot does which job is the difference between an intentional policy and an accidental block. Our explainer on what GPTBot is and how to control it breaks down the individual agents in more detail.

Step one: confirm AI crawlers can reach your content

The first step is verifying that the crawlers you want are allowed and the ones you do not want are handled deliberately. Open your robots.txt and read it against the current list of AI user agents rather than assuming a permissive default.

A common failure is a blanket rule copied from an old template or a security plugin that quietly disallows unfamiliar bots. A single Disallow: / under a wildcard, or a Web Application Firewall rule that rate-limits anything without a browser fingerprint, can remove you from AI answers entirely. Work through this list:

  1. Audit robots.txt for explicit blocks. Search for GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-User, PerplexityBot, CCBot, and Google-Extended. Decide the policy for each on purpose. A reasonable default for most marketing sites is to allow retrieval and user-triggered agents while making a separate, deliberate choice about training crawlers.
  2. Check for platform-level blocking above robots.txt. CDNs and bot-management products can block AI crawlers before robots.txt is ever consulted. If your host offers an “AI bot” or “AI scraper” toggle, confirm it is not silently dropping the retrieval crawlers you want.
  3. Confirm the pages return 200, not 403 or 401. Paywalls, login gates, and geo-blocks that serve a challenge page to non-browser clients hand the crawler an error instead of content.
  4. Fetch as the bot yourself. Request a key page with a GPTBot or PerplexityBot user-agent string and read exactly what comes back. This is the single most revealing test on this list because it shows you the raw bytes the crawler receives.

Note that Google-Extended is a control token, not a crawler. It governs whether your content trains Gemini and Vertex AI, and it does not fetch anything itself. Blocking it does not remove you from Google AI Overviews, which draw from the standard Search index that regular Googlebot builds.

Step two: make sure the content survives the fetch

The second step is proving that the HTML a crawler receives actually contains your words. This is where JavaScript rendering decides your fate.

Run the fetch-as-bot test from the previous step and look at the response body, not the browser view. If the main content is present in the initial HTML, you are in good shape. If the response is a near-empty <div id="root"> waiting for scripts, the AI crawlers that skip JavaScript will get nothing. The fix is to serve meaningful HTML on the first response through server-side rendering, static generation, or prerendering for bots. Frameworks such as Next.js, Nuxt, Astro, and SvelteKit all support this. The goal is simple: the answer a human reads should exist in the source a crawler downloads.

Two related checks belong here:

  • Clean, semantic markup. AI parsers lean on real heading tags, lists, tables, and paragraphs to understand structure. A page built entirely from unlabeled div elements is harder to segment into the coherent passages that get retrieved and quoted.
  • Fast, stable delivery. Retrieval crawlers work on tight time budgets. A page that takes many seconds to return its first byte, or that returns intermittent errors under load, gets fetched less reliably. The same crawl-efficiency thinking from classic SEO applies to AI retrieval, only with less patience.

Once your content reliably survives the fetch, the content tactics that dominate every other guide finally have something to work with.

Step three: work through the optimization checklist

The optimization checklist is the set of on-page and off-page moves that raise your odds of being cited once crawlers can read you. Execute these in order; the earlier items unlock the later ones.

#ActionWhy it matters for AI search
1Put the direct answer firstAI systems extract the sentence that answers the query. Lead each section with a plain, self-contained answer before the supporting detail.
2Write self-contained passagesRetrieval pulls chunks, not whole pages. Each section should make sense if it is the only part quoted, with no reliance on distant context.
3Use question-shaped headingsHeadings that mirror how people ask questions map cleanly onto the queries AI engines fan out into.
4Name entities explicitlyReplace vague pronouns with specific product, brand, and concept names so models can map relationships.
5Add first-hand data and quotesProprietary statistics, case studies, and named-expert quotes are the material AI answers reach for and cannot generate on their own.
6Keep content freshUpdate statistics and dates. AI systems favor recent sources, and a visible last-updated date signals currency.
7Add structured data where it fitsArticle, FAQ, and HowTo schema are not required for citation, but they reinforce meaning and earn rich results in classic search.
8Build off-site authorityAI engines synthesize consensus from across the web, so third-party mentions, reviews, and forum presence carry weight beyond your own domain.

Two of these deserve extra attention because they are where AI search departs most sharply from classic SEO. Writing self-contained passages, item two, is the heart of what practitioners call generative engine optimization: the page is no longer the unit of retrieval, the passage is. Leading with the direct answer, item one, is what gets you pulled into the AI Overview or chat response rather than merely ranked beneath it, a distinction we cover in getting cited in AI Overviews and ChatGPT.

Where llms.txt fits, honestly

The llms.txt file is a proposed markdown file at the root of your domain that offers AI systems a curated map of your most important content. It is cheap to publish and does no harm, so it is worth adding if you can do it in an afternoon. Be clear-eyed about its status, though: no major AI engine has publicly confirmed that it reads llms.txt at retrieval time, and Google has explicitly said it is not required. Treat it as a low-cost, low-confidence bet rather than a foundation, and never let it distract from the crawler-access and rendering work that demonstrably moves the needle. Our full explainer on llms.txt covers the format and the current state of adoption.

Step four: measure results with AI-referral traffic

Measurement is the step every other guide skips, and it is the only way to know whether the work paid off. AI search produces two measurable signals, and you want both.

The first signal is the crawler visit. Before any human sees a citation, an AI retrieval crawler fetches the page it is about to reference. Those hits show up in your server logs and edge logs as requests from GPTBot, OAI-SearchBot, PerplexityBot, and their peers. Watching which AI crawlers arrive, which URLs they fetch, and how often tells you whether your access and rendering fixes actually opened the door. It is the leading indicator: crawler activity rises before referral traffic does.

The second signal is the referral. When a person clicks a citation in ChatGPT, Perplexity, Gemini, or Copilot, your analytics records a referral from a domain like chatgpt.com, perplexity.ai, gemini.google.com, or copilot.microsoft.com. Segmenting these referrers shows you which AI platforms actually send people to your site and which pages earn the clicks. Google Search Console has also begun surfacing AI-surface performance in its reporting, which is the trustworthy first-party view for Google’s own AI features. A practical walkthrough of isolating these sessions lives in how to see your AI-referral traffic.

This is the layer where Lume fits. Lume is the measurement layer for AI search: it shows which AI crawlers reach you, what they fetch, and the referrals that follow, in one place, and it cryptographically verifies that a bot claiming to be GPTBot or ClaudeBot is authentic rather than a spoofed scraper wearing its name. That verification matters because user-agent strings are trivial to forge, and a referral report built on unverified agents overcounts. If you want the connected view from crawler hit to human click, that is what Lume’s AI-referrals view is built to deliver.

Tie the two signals together and you get a causal story rather than a vanity chart. Crawler hits from OAI-SearchBot rise after you fix rendering. A week later, chatgpt.com referrals to that page appear. That sequence is proof the optimization worked, and it is exactly the loop that turns AI search from a black box into a channel you can manage. For teams running this alongside classic search, the two disciplines share the same underlying signals, so the reporting can live side by side.

A one-week execution plan

The plan below sequences everything above into an order a small team can finish in five working days.

  1. Day one: access audit. Read robots.txt against the current AI user-agent list, check CDN and firewall bot rules, and confirm key pages return 200 to a bot user agent.
  2. Day two: rendering audit. Fetch your top 20 pages as GPTBot and confirm the main content is present in the raw HTML. Flag anything that renders empty for a server-side rendering fix.
  3. Day three: structure pass. Rewrite the opening sentence of each key section to answer directly, convert vague headings into question-shaped ones, and make passages self-contained.
  4. Day four: authority and freshness. Update stale statistics, add first-hand data or a named quote where you can, and publish or refresh llms.txt if it is quick.
  5. Day five: measurement setup. Turn on crawler logging, create an AI-referral segment in analytics, and record a baseline so next month’s numbers mean something.

Frequently asked questions

What is the difference between AI search optimization and SEO?

AI search optimization is a layer on top of SEO, not a replacement for it. Classic SEO earns rankings in a list of blue links. AI search optimization earns citations inside a generated answer, which depends on crawlers being able to fetch and parse individual passages of your content. The foundational work overlaps heavily, because a page that is crawlable, fast, and well-structured serves both. The added requirements are passage-level clarity, first-hand information, and confirming that the newer AI crawlers, which behave differently from Googlebot, can actually read you.

Do AI crawlers execute JavaScript?

Most standalone AI crawlers do not. GPTBot, ClaudeBot, PerplexityBot, and CCBot generally fetch the raw HTML response and parse it without running client-side scripts. This means content that only appears after JavaScript executes in a browser is invisible to them. Google AI Overviews are the partial exception, because they draw on the standard Google index that Googlebot builds by rendering pages. The safe rule is to serve your meaningful content in the initial HTML through server-side rendering or static generation.

Should I block AI crawlers in robots.txt?

That depends on which crawler and what you want. Blocking training crawlers such as GPTBot limits how future models learn from your content, which is a reasonable choice for some publishers. Blocking retrieval crawlers such as OAI-SearchBot and PerplexityBot removes you from the live AI answers those systems generate, which is usually the opposite of what a marketing team wants. Decide per user agent rather than applying a single blanket rule, and verify the claimed agents are genuine before trusting any traffic report built on them.

No. The llms.txt file is an optional, proposed standard with no confirmed adoption by major AI engines at retrieval time, and Google has stated it is not required. It is cheap to publish and harmless, so it can be a reasonable low-priority addition, but it is not a substitute for the crawler-access, rendering, and content work that measurably affects whether you get cited. Prioritize the foundation first.

How do I measure AI search results?

Track two signals. The first is AI crawler activity in your server and edge logs, which shows which bots fetch which pages and acts as a leading indicator. The second is AI-referral traffic in your analytics, where clicks from AI answers arrive as referrals from domains like chatgpt.com and perplexity.ai, alongside the AI-surface data now appearing in Google Search Console. Verifying that the crawlers are authentic rather than spoofed keeps those numbers honest. Watching crawler hits rise and referrals follow gives you a causal read on whether your optimization worked.

More posts to read

See the non-human half of your traffic.

Lume shows you every crawler, scraper and AI agent on your site, and verifies which ones are real. Set up in minutes.

Start for free →