Run a technical SEO audit and draft code fixes for review

Last updated

DifficultyMedium
SetupSome code
Best forMarketing
ToolsClaude Code, Cursor, Codex, Screaming Frog SEO Spider, Google Search Console, Grok Bot

Copy this prompt

Paste this into a general agent such as ChatGPT agent or Claude, then add your own inputs.

Help me run this UseCaseProof playbook: Run a technical SEO audit and draft code fixes for review.

The problem: Technical SEO problems are usually invisible until traffic drops: a page accidentally set to noindex, a canonical tag pointing at the wrong URL, a redirect chain, an orphan page nothing links to, broken structured data, or a sitemap full of URLs that return errors. Desktop crawlers find hundreds of warnings at once, and small teams cannot tell which few actually block crawling and indexing, so the report gets filed and nothing is fixed.

How the agent should work: The agent crawls your site starting from the sitemap and the homepage, the way a search engine would. For each URL it records the status code, robots meta tag and X-Robots-Tag header, canonical, title and description, internal links in and out, and any JSON-LD it can parse. It compares what it found against simple rules (every sitemap URL returns 200 and is indexable, every canonical points to itself or a live page, every important page has inbound internal links) and groups the issues by likely impact: indexing blockers first, then duplicate and canonical conflicts, then orphan pages and broken links, then cosmetic warnings. For the top issues it opens your source code or CMS templates, finds where the problem comes from, and drafts the smallest change that fixes it as a branch or pull request with a plain-language explanation. Nothing merges or publishes without a person.

Follow these steps:
1. Write down the rules for your site first: which sections must be indexed, which must stay noindex (thank-you pages, admin, search results), and the canonical domain
2. Give the agent read access to the live site and, for code fixes, a repository or a staging copy of your CMS theme, never production credentials
3. Run the crawl from the sitemap and homepage and have it save a per-URL table: status, robots, canonical, title, inbound links, and schema errors
4. Ask for a ranked issue list grouped by impact, with example URLs and how many pages each issue affects
5. For the top five issues, have the agent trace the cause in your templates or config and draft the smallest fix as a branch or pull request
6. Review every diff yourself, and get a second look at any change to robots.txt, canonicals, redirects, noindex rules or the sitemap
7. Deploy, then have the agent re-crawl the affected URLs and confirm status codes, robots and canonicals now match your rules
8. Schedule the crawl weekly or after each deploy and alert only on new indexing blockers

Human-approval checkpoint: A person writes the indexing rules, approves every code change, and personally reviews any diff touching robots.txt, canonical tags, redirects, noindex or the sitemap, because one wrong line there can remove a whole site from search. A person also decides which warnings are worth fixing at all.

Guardrails: The biggest risk is a confident fix that makes things worse, such as a site-wide noindex, a canonical pointing every page at the homepage, or a redirect loop. Test on staging, keep fixes small, and re-crawl after each deploy. Crawl politely with a low request rate, only crawl sites you own or have permission to test, and do not give the agent deploy or DNS access. Treat its guesses about ranking impact as hypotheses, not facts; Search Console data is the source of truth for what Google actually indexed.

Suggested tools from this playbook (not ranked; check current features and pricing): Claude Code, Cursor, Codex, Screaming Frog SEO Spider, Google Search Console, Grok Bot.

Do not send messages, move money, grant access, merge code, or take any irreversible action until I approve. If you need an input I have not provided, ask me instead of guessing.

The problem

Technical SEO problems are usually invisible until traffic drops: a page accidentally set to noindex, a canonical tag pointing at the wrong URL, a redirect chain, an orphan page nothing links to, broken structured data, or a sitemap full of URLs that return errors. Desktop crawlers find hundreds of warnings at once, and small teams cannot tell which few actually block crawling and indexing, so the report gets filed and nothing is fixed.

How the agent works

The agent crawls your site starting from the sitemap and the homepage, the way a search engine would. For each URL it records the status code, robots meta tag and X-Robots-Tag header, canonical, title and description, internal links in and out, and any JSON-LD it can parse. It compares what it found against simple rules (every sitemap URL returns 200 and is indexable, every canonical points to itself or a live page, every important page has inbound internal links) and groups the issues by likely impact: indexing blockers first, then duplicate and canonical conflicts, then orphan pages and broken links, then cosmetic warnings. For the top issues it opens your source code or CMS templates, finds where the problem comes from, and drafts the smallest change that fixes it as a branch or pull request with a plain-language explanation. Nothing merges or publishes without a person.

Setup steps

  1. Write down the rules for your site first: which sections must be indexed, which must stay noindex (thank-you pages, admin, search results), and the canonical domain
  2. Give the agent read access to the live site and, for code fixes, a repository or a staging copy of your CMS theme, never production credentials
  3. Run the crawl from the sitemap and homepage and have it save a per-URL table: status, robots, canonical, title, inbound links, and schema errors
  4. Ask for a ranked issue list grouped by impact, with example URLs and how many pages each issue affects
  5. For the top five issues, have the agent trace the cause in your templates or config and draft the smallest fix as a branch or pull request
  6. Review every diff yourself, and get a second look at any change to robots.txt, canonicals, redirects, noindex rules or the sitemap
  7. Deploy, then have the agent re-crawl the affected URLs and confirm status codes, robots and canonicals now match your rules
  8. Schedule the crawl weekly or after each deploy and alert only on new indexing blockers

Tools that can do this

  • Claude Code
  • Cursor
  • Codex
  • Screaming Frog SEO Spider
  • Google Search Console
  • Grok Bot

Some tool links may be affiliate links. We only list tools that fit the playbook; recommendations are not sold. Disclosure.

Not ranked. Tools marked Featured pay for a highlighted listing; that never decides which tools we include. Check each vendor's current features and pricing.

Make one of these tools? Feature your tool on every playbook where it is already listed.

Human in the loop

A person writes the indexing rules, approves every code change, and personally reviews any diff touching robots.txt, canonical tags, redirects, noindex or the sitemap, because one wrong line there can remove a whole site from search. A person also decides which warnings are worth fixing at all.

Risks and guardrails

The biggest risk is a confident fix that makes things worse, such as a site-wide noindex, a canonical pointing every page at the homepage, or a redirect loop. Test on staging, keep fixes small, and re-crawl after each deploy. Crawl politely with a low request rate, only crawl sites you own or have permission to test, and do not give the agent deploy or DNS access. Treat its guesses about ranking impact as hypotheses, not facts; Search Console data is the source of truth for what Google actually indexed.

ROI notes

Measure your own before and after: indexable pages in Search Console, crawl errors, orphan pages, and hours spent on the audit compared with your last manual one. The value is that blockers are found and fixed in days instead of sitting in an unread report; no change guarantees a ranking improvement.

Quick answers

How do I run a technical SEO audit and draft code fixes for review?

The agent crawls your site starting from the sitemap and the homepage, the way a search engine would. The full setup is 8 steps.

Do I need to code to set this up?

Some code is needed. We rate the setup Medium.

Which tools can do this?

Claude Code, Cursor, Codex, Screaming Frog SEO Spider, Google Search Console, Grok Bot. Not ranked; check each vendor's current features and pricing.

Where does a human stay in control?

A person writes the indexing rules, approves every code change, and personally reviews any diff touching robots.txt, canonical tags, redirects, noindex or the sitemap, because one wrong line there can remove a whole site from search.

What's a starter prompt I can paste into ChatGPT agent or Claude?

A playbook-specific starter prompt is in the Copy this prompt section above. It is written from this playbook's steps and human-approval checkpoint, for a general agent such as ChatGPT agent or Claude.

Also useful: generate SEO content briefs from live search results; keep your site's facts up to date every month; run browser QA checks before release; get a first-pass review on every pull request.

All AI agent examples, by function · More Sales & Marketing playbooks