Skill

Robots.txt Setup skill for Claude

Robots.txt Setup writes or audits your robots.txt so search and AI crawlers reach the pages you want, and nothing important gets blocked by accident

A 2-minute read, updated

The recorded run

Read the run as text

Search Console says 40 pages are blocked by robots.txt and guide traffic has slid since our redesign, so audit and fix the file to let ChatGPT and Perplexity cite us without AI training

  • robots.txt20 lines
  • blocked-by-robots.csv40 rows
  • top-pages-3m.csv20 rows
  • ga4-ai-referrals.csv5 rows
Using the skill Robots.txt Setup
Matching 40 blocked URLs to the rules in robots.txt
Which rule blocks what
RuleBlocked URLsVerdict
Disallow: /tea-guides/14Wrong: blocks guide pages
Disallow: /*?filter_9Correct
Disallow: /wp-includes/6Wrong: blocks JS and CSS
Disallow: /wp-content/plugins/4Wrong: blocks JS and CSS
Disallow: /cart/, /checkout/3Correct
/my-account/, /thank-you/4Wrong: noindex pages
Blocked guide pages in your top 20 (clicks, 3 months)
  • /tea-guides/how-to-brew-oolong/1,286
  • /tea-guides/matcha-vs-sencha/942
  • /tea-guides/gongfu-brewing-ratios/655
  • /tea-guides/caffeine-in-green-tea/471
  • /tea-guides/water-temperature-chart/352
  • 2 more guide pages316

28 of 40 blocks are mistakes. The 7 blocked guides earned 4,022 of 12,142 clicks (33%). They stay indexed from before, but Google can no longer crawl them or see edits.

Format and AI crawler checks2 passed1 to check3 failed
  • failed: Disallow uses a full URL for /staging/, so nothing is blocked
  • failed: Sitemap line is relative, needs an absolute URL
  • needs a look: /Blog/drafts/ never matches /blog/drafts/ (case-sensitive)
  • failed: anthropic-ai token is retired and has no effect
  • passed: GPTBot training block works
  • passed: AI assistants sent 314 sessions, so AI search bots stay allowed

A fixed robots.txt to paste

  • Unblocks /tea-guides/, /wp-includes/, /wp-content/plugins/ and the noindex pages
  • Keeps admin, cart, checkout, /staging/ and filter URLs blocked
  • Allows OAI-SearchBot, Claude-SearchBot and PerplexityBot and blocks GPTBot, ClaudeBot, CCBot and Google-Extended
  • Absolute Sitemap URL, with blocked pages expected to fall from 40 to about 12

The run is one sample task, kept exactly as it came out

How it works

How Robots.txt Setup works step by step

What it asks first

It starts from your domain, the paths you want kept out of crawling, and whether AI training bots should be blocked

Step 1 of 6

Crawl control is not index control

The skill treats robots.txt as crawl control only: a disallowed URL can still appear in search results without a snippet. Keeping a page out of the index is a job for noindex (meta tag or X-Robots-Tag). nofollow only affects link equity. Because robots.txt is public, sensitive content needs noindex or a login rather than a Disallow line.

What to block and what to leave open

Path-level blocks are for folders that do not need crawling, such as /admin/, /api/, /staging/ and temp files. Page-level exclusions such as /login/, /signup/ and /thank-you/ get noindex and stay crawlable. CSS, JS, images and Next.js /_next/ are never blocked, because Google needs them to render pages.

Format rules that cause silent errors

The file lives at the site root, as UTF-8 plain text, following RFC 9309. Disallow and Allow take root-relative paths, so a full URL there is wrong, and Sitemap needs an absolute URL. The more specific path wins, so Allow: /shop/shoes/ overrides Disallow: /shop/. Wildcards are * for any sequence and $ for an exact ending.

AI crawler table

The skill lists each AI user agent with a typical setting: OAI-SearchBot, Claude-SearchBot, Claude-User, PerplexityBot and AppleBot are allowed, while GPTBot, ClaudeBot, Google-Extended, CCBot, Bytespider and Meta-ExternalAgent are blocked. The old anthropic-ai token is retired and has no effect. ChatGPT-User stopped following robots.txt in December 2025, so blocking it needs server-side controls such as WAF rules.

Optional Yandex parameter cleanup

For sites that care about Yandex, the skill can add a Clean-param line that strips tracking parameters such as utm_source, utm_medium, utm_campaign, fbclid and gclid from crawled URLs

Rules it keeps

Thresholds and limits written into the skill, each with the reason behind it

  1. Disallow and Allow take root-relative paths that start with /, and the Sitemap line takes an absolute URL

    A full URL in a Disallow line or a relative Sitemap line is a common error that makes the rule fail

  2. Pages that use noindex are never blocked in robots.txt

    Crawlers must access the page to read the noindex directive

  3. CSS, JavaScript and images stay unblocked, because Google needs them to render and index pages

    Pages that cannot be rendered can be misread or left out of the index

  4. Only paths that need no crawling get blocked, such as /admin/, /api/, /staging/ and temporary files

    Every other path should stay open so search and AI search bots can reach it

  5. Path matching is case-sensitive: Disallow: /PDF/ does not match /pdf/

    A rule with the wrong case looks correct but blocks nothing

What it needs and what comes back

You give it

  • Site URL
  • Current robots.txt, if any
  • Paths to keep out of crawling
  • Stance on AI training bots
  • Search Console list of pages blocked by robots.txt (for audits)

It hands back

A current-state summary when auditing, a complete recommended robots.txt, a compliance checklist and a reference link to Google's robots.txt documentation

When it helps

  • Search Console shows pages as blocked by robots.txt
  • You want ChatGPT and Perplexity to cite you without feeding model training
  • You are launching a site or moving off a staging domain

Prompts to start with

Check our robots.txt for mistakes and give me a fixed version

Write a robots.txt for example.com on Next.js that blocks /admin/ and /api/, allows AI search bots and blocks training bots

Search Console says 340 pages are blocked by robots.txt, so which rule is doing it and is that a problem?

Adding it to Claude

claude.ai

Download robots-txt-setup.zip, upload it still zipped in Settings, Capabilities, Skills and ask for the job in a new chat, as Anthropic's help article on using skills in Claude shows

Claude Code

unzip robots-txt-setup.zip -d ~/.claude/skills/

To use it in one project only, move the folder inside the zip (it is called robots-txt) into that project's .claude/skills/, as the Claude Code skills docs describe

Inside the zip

robots-txt-setup.zip3 files in 7 KB
  • robots-txt/
  • CHANGES.md2 KB
  • SKILL.md13 KB

Questions

Will a Disallow line remove a page from Google?

No, it stops crawling and a blocked URL can still show up without a snippet, so to keep a page out of the index use noindex and leave the page crawlable

Can robots.txt block ChatGPT browsing?

Since December 2025 ChatGPT-User no longer follows robots.txt, which still works for GPTBot and OAI-SearchBot, so blocking user-initiated browsing needs server-side controls such as firewall rules

More in Technical SEO