Claude Code for SEO: an agentic terminal workflow turning a site crawl into an audit report, with a human review checkpoint before publishing

Claude Code for SEO: A Practical Guide to Automating Audits and Content Workflows

In short

Claude Code for SEO means using Anthropic’s agentic coding tool to run repeatable SEO tasks — technical audits, content briefs, JSON-LD schema, internal-link suggestions and Search Console analysis — by reading files, calling APIs and running scripts. It works best as a drafting and analysis engine: every output is verified and approved by a human before anything goes live.

SEO teams are no longer asking whether to work with AI. In SEOFOMO’s 2026 State of AI Search Optimization survey, run by Aleyda Solís between 17 and 27 August with 171 respondents, 69% of respondents had a budget allocated to AI search optimisation, up from 38% the year before (SEOFOMO). The harder question is how to automate without shipping mistakes at scale.

69%

of respondents had a budget allocated to AI search optimisation

171

respondents to SEOFOMO’s 2026 State of AI Search Optimization survey

Year before38%
2026 survey69%
Source: SEOFOMO, State of AI Search Optimization 2026, survey run by Aleyda Solís, 17–27 August, 171 respondents

I use Claude Code every day for client SEO work at Web First Rank. This guide covers seven workflows I rely on. Each one comes with an example prompt, the output to expect and the human checkpoint that keeps it safe. You will also find a table matching each SEO task to the right Claude Code feature, and the guardrails I set up before giving an agent access to a live site.

What Claude Code is (and isn’t) for SEO work

Claude Code is a tool developed by Anthropic. Anthropic describes Claude Code as an agentic coding tool that reads your codebase, edits files and runs commands (Claude Code documentation). It runs on Claude, Anthropic’s family of large language models.

For an SEO, “codebase” simply means a project folder. That folder can hold a sitemap export, a crawl file, a keyword list, a set of Markdown drafts or a few Python scripts. Claude Code can read those files, write new ones, run the scripts and call external tools. That is what makes it different from a chat window: it does not just suggest an audit, it runs one and saves the result.

It is not a rankings button. It does not know your client’s commercial priorities, it cannot judge whether an angle is genuinely useful to readers, and it can be confidently wrong about a figure. The way how SEO has changed makes this more important, not less: speed is cheap now, judgement is not. Treat Claude Code as a fast junior analyst who never gets tired and always needs review.

Setting up Claude Code for SEO work

Install and choose a plan

As of November 2026, Claude Code is available in the terminal, in IDEs, in a desktop app and in the browser. Most of these surfaces require a paid Claude subscription or an Anthropic Console (API) account. Check Anthropic’s pricing page for current plans. At the time of writing (30 October 2026), the Pro plan includes Claude Code and is listed at US$20 per month billed monthly, and Max plans start at US$100 per month.

If you are not comfortable in a terminal, start with the desktop app. The workflows below behave the same way, and you can move to the command line once the logic feels familiar.

One project folder per site, with a CLAUDE.md

Create one folder per website. Inside it, add a CLAUDE.md file: Claude Code reads it at the start of every session as persistent instructions. Put your durable rules there — brand voice, target markets, the CMS in use, where data files live, and lines like “never publish; drafts only” and “flag any figure without a primary source”.

Never put passwords, API keys or tokens in CLAUDE.md. Keep credentials in environment variables or a secrets manager, and keep the file readable by anyone on the team.

Connect your data with MCP

The Model Context Protocol (MCP) is an open-source standard for connecting AI applications to external systems (modelcontextprotocol.io). In practice, an MCP server gives Claude Code direct access to a tool you already use. For SEO, the useful ones are Google Search Console, a keyword data provider such as DataForSEO, and your CMS.

Prefer read-only access wherever the provider offers it. An agent that can only read your Search Console data cannot break anything in it.

Permissions before prompts

Before you write a single prompt, decide what the agent may do without asking, what it must ask about and what it may never do. Claude Code stores these rules in a settings.json file, with allow, ask and deny lists. The guardrails section below shows a working example.

Workflow 1: A technical SEO audit you can rerun

The first workflow is a crawl of a URL list or sitemap that checks the basics: HTTP status, canonical tag, title length, meta robots and H1 count. The value is not the crawl itself — dedicated crawlers do that well. The value is a check you can rerun in one line next month, on the same URLs, with the same rules.

Read sitemap.xml, fetch every URL, and output audit.csv with status, canonical, title length, meta robots and H1 count. Then summarise the top 10 issues by likely impact. Do not change any file on the site.

What you get: an audit.csv file with one row per URL, and a short prioritised note explaining the ten issues most likely to matter. Ask Claude Code to save the script it wrote, so the next run uses the same logic.

Human checkpoint: open five URLs from the file in a browser and compare. Look hard for false positives. A firewall or anti-bot page can return a page that looks fine to a script while real users see the article, and some servers send a 403 only to automated clients. If a “200 OK” page has a suspiciously short title, the script probably fetched a challenge page.

Workflow 2: Content briefs from keyword data

Connected to a keyword data source, Claude Code can pull search volumes and current top-ranking pages, read them for intent and structure, and draft a brief. The point is to start the editorial conversation from evidence rather than a blank page.

Using DataForSEO, pull volume and top-10 results for "[keyword]" (UK and US). Draft a brief: intent, H2 outline, questions to answer, entities, and sources to cite. Flag any figure you could not verify.

What you get: a Markdown brief with the search intent, a proposed outline, the questions readers ask, the entities to cover and a list of sources. The last instruction matters most: it forces the agent to separate what it checked from what it assumed.

Human checkpoint: the subject-matter expert validates the angle and traces every figure back to its primary source — the organisation that produced it, not a blog that repeated it. A brief built on a misattributed statistic will produce an article built on one too.

Workflow 3: Schema markup (JSON-LD) generation and validation

Schema.org markup written in JSON-LD is tedious to write by hand and easy to get subtly wrong. Claude Code can generate BlogPosting, Person, Organization and BreadcrumbList nodes from the real content of a page, link them with @id references and check that the result parses.

Generate JSON-LD for this post using only facts present in post.md. Use @id references for the author and publisher. Validate that the JSON parses, and list every property you guessed.

What you get: a JSON-LD block and a list of guessed properties. That list is your review queue. An image URL is a typical example: WordPress can rename a file on upload, so an image URL predicted before upload must be checked afterwards.

Human checkpoint: run the markup through Google’s Rich Results Test and the Schema Markup Validator, and confirm that every value is visible on the page. Then adjust your expectations to 2026. Google stopped showing FAQ rich results in Search on 7 May 2026 (Google Search Central). Google has deprecated HowTo rich results, which no longer appear on desktop or mobile. Google says structured data isn’t required for generative AI search (Google’s guide to generative AI search). Google still recommends structured data as part of an overall SEO strategy, because it helps pages become eligible for the rich results that remain. Just don’t promise a client FAQ snippets.

Workflow 4: Internal-link suggestions

Internal linking is a good fit for an agent because it is a matching problem across many pages. Give Claude Code an inventory of your published URLs and ask for suggestions, never insertions.

From pages.csv (URL, title, H1, summary), propose up to 3 internal links per new post: source paragraph, target URL, anchor text, reason. Avoid exact-match anchors repeated across pages.

What you get: a CSV with source, target, anchor and a one-line reason for each link. The reason column is what lets an editor accept or reject a suggestion in seconds.

Human checkpoint: check editorial relevance, make sure anchors read naturally in the sentence, and watch for two pages competing for the same query. Only link to pages that are already live.

Workflow 5: Search Console and log-file analysis

Google Search Console is where most SEO questions start. Through an MCP server or a short script calling the Search Console Search Analytics API, Claude Code can compare periods, find pages losing clicks and surface queries with many impressions but few clicks. The Search Console Search Analytics API returns up to 25,000 rows per request, with a default of 1,000 (Google developer documentation). For a large site, ask the agent to paginate rather than accept the first page.

Query the Search Console API for the last 90 days vs the previous 90, by page and query. List pages losing more than 20% clicks and queries with high impressions and CTR below 1%. Show the API request you used.

What you get: two tables — declining pages and low-CTR queries — plus the exact API request. Showing the request lets you see the date range, dimensions and filters the numbers came from.

The same approach works on server logs. Ask Claude Code to count Googlebot hits per section, or requests from AI crawlers, and to list the user agents it grouped together. Logs are large, which makes them a good job for a subagent (see the feature table below).

Human checkpoint: cross-check two or three figures in the Search Console interface. Totals grouped by page and by query rarely match exactly, so an agent that adds them up can produce a confident but wrong number.

Workflow 6: CMS drafts in WordPress (draft only)

Moving a finished article into WordPress by hand is slow and error-prone. Claude Code can create the post through the WordPress REST API, authenticated with WordPress Application Passwords (available since WordPress 5.6), or through a command-line tool. The status is always draft.

Create a WordPress draft from article.md with the title, slug and excerpt below. Status must be "draft". Return the edit link. Never set status to publish or future.

What you get: a draft post and its edit link. Ask the agent to read the stored content back and compare it with the local file: some CMS write paths silently strip backslashes or reformat markup.

Human checkpoint: review the draft in the editor, check the mobile preview, the SEO plugin fields and every link. Scheduling and publishing stay human actions.

Workflow 7: Scheduled monitoring

Some checks are only useful if they run every week: are the key pages still indexable, are their titles intact, does their schema still parse? Claude Code offers two ways to run them unattended. Cloud scheduled tasks (formerly called routines) run on Anthropic’s infrastructure, so they keep working when your computer is off. Desktop scheduled tasks run on your own machine, with access to your local files, while the app is open (Claude Code documentation).

Every Monday at 07:00, fetch the 20 URLs in key-pages.csv. Check status code, canonical, title, meta robots and whether the JSON-LD parses. Compare with last week's report and list only the changes. Write the report to reports/ and do not fix anything.

What you get: a short weekly report that lists changes only, so an unchanged week takes ten seconds to read.

Human checkpoint: a person reads the report and decides what to fix. Automatic fixes on a live site are exactly the kind of change you want a human to own.

Which Claude Code feature for which SEO task

Claude Code has several extension points, and choosing the right one keeps a workflow cheap to maintain. Skills are reusable instructions saved in a SKILL.md file, which you can call by name, such as /seo-audit. Subagents work in their own context window with their own tool access, which suits large, noisy jobs. Hooks run your own script at fixed points, for example before every tool call. MCP servers connect external tools and data (skills, subagents, hooks).

SEO task

Claude Code feature

Human check

Rerunnable technical audit

Skill (e.g. /seo-audit) + script

Spot-check 5 URLs, hunt false positives

Keyword research and brief

MCP server (keyword data) + skill

Expert validates the angle and every figure

Heavy crawl or log parsing

Subagent (own context, limited tools)

Sample the raw data

JSON-LD generation

Skill + validation script

Rich Results Test, no invented facts

Blocking dangerous actions

Hook (PreToolUse) + deny rules

Review the blocked-action log

Search Console analysis

MCP server or API script

Cross-check figures in the Search Console interface

WordPress drafts

REST API or CLI, draft only

Editorial review before scheduling

Weekly monitoring

Cloud or Desktop scheduled tasks

A human reads the report and decides

Claude Code for SEO feature map: skills, subagents, hooks and MCP servers matched to SEO tasks
Matching each SEO task to the right Claude Code feature

Guardrails: how to automate SEO without losing control

Most guides stop at the prompts. The guardrails are what make it reasonable to point an agent at a client’s site.

Least-privilege credentials

Give the agent its own WordPress user with the Author or Editor role, never an administrator. Authenticate it with an Application Password you can revoke in one click. Use read-only API keys wherever the provider offers them. If a credential leaks or a prompt goes wrong, the damage is limited to what that account could do.

Permission rules

Claude Code evaluates permission rules in this order: deny, then ask, then allow (Claude Code permissions). A broad deny rule blocks an action even when a more specific allow rule matches it. Permission rules are enforced by Claude Code itself, while instructions in CLAUDE.md only shape what the model tries to do. A “never publish” line in CLAUDE.md is a good habit; a deny rule is a control.

{
  "permissions": {
    "deny": [
      "Read(./.env)",
      "Bash(wp post delete *)"
    ],
    "ask": [
      "Bash(curl *)",
      "Bash(wp post update *)"
    ],
    "allow": [
      "Bash(python scripts/audit.py *)",
      "Read(./data/**)"
    ]
  }
}

Command rules match the command text the agent writes, so the documentation itself warns that they are not a security boundary around a program. That is why the next layer exists.

A hook as a safety net

A PreToolUse hook runs your own script before a tool call executes, and it can block that call. A useful pattern is a hook that inspects every outgoing request and refuses any request body containing "status":"publish" or "status":"future", whichever tool the agent used to build it. The hook returns a deny decision with a reason, and the agent sees why it was stopped.

The editorial pipeline

Every article moves through four states: DRAFT, REVIEW, SCHEDULED, PUBLISHED. Claude Code never goes beyond DRAFT. Review is an editor’s job, and scheduling is a human decision, made in the CMS by a person who has read the piece.

  1. DRAFT: the only state Claude Code reaches. It creates the post through the REST API, with a limited-role user.
  2. REVIEW: an editor checks the draft in the editor, the mobile preview, the SEO plugin fields and every link.
  3. SCHEDULED: a human decision, made in the CMS by a person who has read the piece.
  4. PUBLISHED: a human action. The agent never sets the status to publish or future.
Claude Code for SEO guardrails: the agent stops at the draft stage, and review, scheduling and publishing stay human decisions
Draft, review, schedule, publish: where the agent stops

Verify everything

Figures go back to a primary source. Schema goes through the validators. Audits get a manual sample. This is not only quality control; it is also how you stay on the right side of Google. Google states that appropriate use of AI or automation is not against its guidelines (Google Search Central). Using automation with the primary purpose of manipulating search rankings violates Google’s spam policies. Mass-producing pages without value is the pattern to avoid — Google calls it scaled content abuse — and a human checkpoint at each step is the simplest defence.

Limits and common mistakes

  • Invented or misattributed figures. A language model can produce a plausible statistic, or attribute a number to the page that quoted it rather than the study that produced it. Ask for the source URL of every figure and open it.
  • Anti-bot pages read as “OK”. A script that receives a challenge page records a status code and a title, not an error. Check the length and content of what was fetched, not just the status.
  • Usage costs. Long crawls and large log files consume usage quickly. Pre-process big files with a script, and send the agent summaries rather than raw dumps.
  • Chasing AI-search myths. Google’s guide to generative AI search says AI text files such as llms.txt can be ignored for Google Search. Spend the agent’s time on content quality and crawlability instead.
  • Feature drift. Claude Code changes quickly: routines, for example, are now called cloud scheduled tasks. Date your internal documentation and recheck feature names before you train a team on them.

FAQ

Can Claude Code do SEO?

Yes, as an assistant that runs tasks: it can crawl pages, parse Search Console data, draft briefs and generate JSON-LD. It does not replace strategy or editorial judgement, and its outputs need human verification before they go live.

Is Claude Code free?

No. Most surfaces require a paid Claude subscription or an Anthropic Console (API) account. Check Anthropic’s pricing page for current plans, as they change.

Can Claude Code connect to Google Search Console?

Yes, through an MCP server or a script calling the Search Console API. Use read-only access and cross-check key figures in the Search Console interface.

Should Claude Code publish directly to WordPress?

It can technically, but it shouldn’t. Let it create drafts through the REST API with a limited-role user, and keep scheduling and publishing as human decisions.

Does Google penalise AI-generated SEO content?

Google says appropriate use of AI is not against its guidelines; using automation mainly to manipulate rankings, or mass-producing pages without value, violates its spam policies.

Do I still need FAQ or HowTo schema?

Google no longer shows FAQ or HowTo rich results, so don’t add them for snippets. Valid structured data that matches visible content can still describe your page.

Start small, keep the human in charge

You do not need all seven workflows on day one. Start with the rerunnable audit and the Search Console comparison: they are read-only, so the worst outcome is a wrong report that your checkpoint catches. Add drafts and scheduled monitoring once your permissions and hook are in place. Claude Code for SEO pays off when it handles the repetitive analysis and you keep the decisions.

Train your team to run Claude Code for SEO safely

If you want help setting this up for your team, I am digital growth strategist Aymen Turki, and at Web First Rank we run Claude Code for SEO training and SEO/GEO support for in-house teams and agencies.

Aymen Turki

Digital growth strategist and CEO of Web First Rank. 22+ years in SEO, GEO & AEO, digital marketing and lead generation, helping companies in the GCC and beyond grow their visibility in search engines and AI answers.

Profile Picture
Hi, I’m Aymen, ready to boost your digital performance.
📲 WhatsApp: ‪+216 23 446 001‬
Hire me