# 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 Nov 30, 2026

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.txt 20 lines
- blocked-by-robots.csv 40 rows
- top-pages-3m.csv 20 rows
- ga4-ai-referrals.csv 5 rows

Using the skill **Robots.txt Setup**

Matching 40 blocked URLs to the rules in robots.txt

Which rule blocks what

| Rule | Blocked URLs | Verdict |
|---|---|---|
| Disallow: /tea-guides/ | 14 | Wrong: blocks guide pages |
| Disallow: /*?filter_ | 9 | Correct |
| Disallow: /wp-includes/ | 6 | Wrong: blocks JS and CSS |
| Disallow: /wp-content/plugins/ | 4 | Wrong: blocks JS and CSS |
| Disallow: /cart/, /checkout/ | 3 | Correct |
| /my-account/, /thank-you/ | 4 | Wrong: 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 pages 316

**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 checks 2 passed 1 to check 3 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

- [Download the skill: robots-txt-setup.zip (7 KB)](https://marketingengineeringacademy.com/downloads/robots-txt-setup.zip)

- Files: 3

- SKILL.md: 191 lines

- Works in: claude.ai, Claude Code

- Area: [Technical SEO](https://marketingengineeringacademy.com/areas/technical.html)

Technical SEO

- [Schema Builder](https://marketingengineeringacademy.com/skills/schema-builder.html)
- [Site Architecture](https://marketingengineeringacademy.com/skills/site-architecture.html)
- [Hreflang Audit](https://marketingengineeringacademy.com/skills/hreflang-audit.html)
- [Schema Markup Checker](https://marketingengineeringacademy.com/skills/schema-markup-checker.html)
- [Schema Markup](https://marketingengineeringacademy.com/skills/schema-markup.html)

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

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

Pages that use noindex are never blocked in robots.txt

Crawlers must access the page to read the noindex directive

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

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

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](https://support.claude.com/en/articles/12512180-use-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](https://code.claude.com/docs/en/skills) describe

## Inside the zip

- [robots-txt-setup.zip: 3 files in 7 KB](https://marketingengineeringacademy.com/downloads/robots-txt-setup.zip)

- robots-txt/
- CHANGES.md 2 KB
- SKILL.md 13 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

- [Schema Builder: JSON-LD code for each page type, checked against Google's current rich results](https://marketingengineeringacademy.com/skills/schema-builder.html)
- [Site Architecture: Plans the page tree, URLs, navigation and internal links of a website](https://marketingengineeringacademy.com/skills/site-architecture.html)
- [Hreflang Audit: Hreflang errors per language version, plus corrected tags or a sitemap](https://marketingengineeringacademy.com/skills/hreflang-audit.html)
- [Schema Markup Checker: Checks the schema on a page for errors and writes JSON-LD you can paste](https://marketingengineeringacademy.com/skills/schema-markup-checker.html)

---

HTML version: https://marketingengineeringacademy.com/skills/robots-txt-setup.html
