Fix Your SEO and Get Cited by AI Search with Claude Code
Audit crawl access, site health and Search Console data with Claude Code, then rewrite key pages so Google and AI assistants can find and cite them
SEO used to have one job: rank in Google. Now it has two. You still want the blue links, and you also want ChatGPT, Claude, Perplexity and Google's AI answers to cite your site when someone asks a question you can answer. Most sites are fine at one and invisible in the other. This is how I audit and fix both with Claude Code, on sites I build and ship myself.
What AI search actually needs
There is a lot of noise about "optimizing for AI." It sounds like a new discipline. In practice, most of it is the old discipline done properly. Google says it plainly in its guide to AI features: there are no extra requirements to appear in AI Overviews or AI Mode. A page must be indexed and eligible to show with a snippet, and you do not need special AI text files or markup.
So the work splits into three parts:
- Access. Search crawlers, including the ones AI assistants use, can reach your pages.
- Health. Pages are indexed, fast, and correctly marked up.
- Citability. Your content answers real questions clearly enough that a machine can quote it.
Step 1: check who can crawl you
Open your robots.txt. Many sites block AI crawlers by accident through a template or a security setting. Know the difference between bots that train models and bots that power search:
- OpenAI:
OAI-SearchBotsurfaces sites in ChatGPT search.GPTBotis for training. See OpenAI's crawler docs. - Anthropic:
Claude-SearchBotindexes for search,Claude-Userfetches pages when a person asks Claude something, andClaudeBotcollects training data. See Anthropic's crawler article.
You can block training and still allow search. If you want to be cited, make sure the search bots are not blocked:
User-agent: OAI-SearchBot
Allow: /
User-agent: Claude-SearchBot
Allow: /
User-agent: Claude-User
Allow: /
If your site sits behind a CDN or firewall with bot protection, check that too. A permissive robots.txt does nothing if the firewall answers crawlers with a challenge page.
Step 2: run the audit with Claude Code
If your site's code is in a folder on your machine, open Claude Code there. This is where it beats any SEO dashboard, because it can read the templates and fix them, not only report on them.
Audit this site for search and AI citation readiness. Check every page for:
title and meta description (unique, right length), one h1, heading order,
canonical tags, hreflang if the site has languages, image alt text,
internal links, structured data (JSON-LD), sitemap.xml, robots.txt, and
any page that is noindex by mistake. Also check the live site at [URL]
for status codes and redirects.
Output a table: page, problem, severity, the file that causes it.
Do not change anything yet.
Want a ready made skill instead? Anthropic publishes a marketing plugin that includes an SEO audit skill:
claude plugin marketplace add anthropics/knowledge-work-plugins
claude plugin install marketing@knowledge-work-plugins
There is also the open source claude-seo plugin, MIT licensed, with commands like /seo audit and /seo geo for AI search. It is a third party project, so read what it installs before you run its setup.
Step 3: bring in your real Search Console data
Generic advice is cheap. What makes the fix list useful is knowing which pages already get impressions and which queries you almost rank for. In Google Search Console, open the Performance report, set the range to the last 3 months, and export queries and pages. Also export the list of pages that are not indexed. Drop the files into a seo-data/ folder in your project.
If you would rather query Search Console directly from Claude, mcp-gsc is an open source MCP server for it. It needs a Google Cloud OAuth client or service account, which takes about as long as the export, so start with the CSVs.
Do the same in Bing Webmaster Tools. Google is not the only index AI answers draw from.
Step 4: turn everything into one ranked list
You have three inputs: the audit table from this session, and the
Search Console exports in seo-data/ (queries, pages, not indexed).
Cross reference them and give me ONE prioritized fix list.
For each item: the problem, the evidence (which file or data row),
expected impact (Google traffic, AI citations, or both), effort
(quick, medium, project), and the exact change.
Top of the list: pages with high impressions and low click rate,
pages ranking 5 to 15 for a query, and anything blocking indexing.
Skip anything that is already fine.
Pages ranking just off page one with plenty of impressions are usually the fastest wins. A better title and a clearer first paragraph can move them.
Step 5: make pages easy to cite
This is the part people call GEO. It looks like a trick. In reality it is clear writing with structure a machine can parse. Ask Claude to rewrite your top pages with these rules:
Rewrite [page] so it is easy to quote as an answer.
1. Put a direct 2 to 3 sentence answer to the main question right under the h1.
2. Use h2 headings phrased the way people actually ask.
3. Add concrete facts: numbers with sources, dates, named methods.
4. Show who wrote it and when it was last updated.
5. Add JSON-LD that matches the visible content (Article, Product,
or Organization as appropriate). Nothing invisible.
Keep my voice. Show me a diff before saving.
Original information matters most. A page that restates what ten other pages say gives an AI no reason to cite you. Your own data, examples and opinions do.
Validate structured data with Google's Rich Results Test and check speed with PageSpeed Insights. An llms.txt file is an optional proposal; add one if you like, and do not expect it to change rankings.
Step 6: measure, then repeat monthly
Search changes slowly. Give fixes four to six weeks, then compare Search Console again. For AI visibility, keep a short list of the questions your customers ask and try them in ChatGPT, Claude and Perplexity once a month. Note whether you are cited and who is cited instead. Those competitor pages tell you exactly what the answer engines consider a good source.
Start with Step 1 today. It takes ten minutes and it is the one fix that can make everything else work. Then run the audit prompt in Claude Code and fix the top five items before you touch anything else.