robots.txt Generator & Tester · Tutorial
How to block AI crawlers but keep search engines
6 min readbeginnerUpdated
You want your articles to stay in search results but not be collected by AI companies. This tutorial builds a robots.txt with a separate group for AI crawlers, tests it with real crawler names, and explains what it can and can’t do.
What you need
- The robots.txt Generator & Tester
- Access to upload a file to your site’s root folder
Steps
Start from the AI template
Press Block AI crawlers. The tool creates two groups: one for all crawlers (
*) with nothing blocked, and one listing AI crawlers withDisallow: /. The sample file also blocks the checkout for everyone and adds a sitemap.Understand the two groups
A crawler follows the group that names it, and only if none does, the
*group. So Googlebot uses the first group and may crawl, while GPTBot finds its own name in the second group and is blocked everywhere.User-agent: * Disallow: /checkout/ User-agent: GPTBot User-agent: ClaudeBot Disallow: /Test with a search engine
In Test a URL, keep the crawler as Googlebot and enter
/blog/my-article. The result says Allowed, following the rules for all crawlers.Test with an AI crawler
Change the crawler to GPTBot. The same URL is now Blocked by
Disallow: /in the rules for GPTBot. Try CCBot and Google-Extended too.Remember the shared rules
The AI group doesn’t inherit the checkout rule from
*. Here that doesn’t matter because it blocks everything, but if you give a bot its own group, repeat any shared rules in it.Publish the file
Download robots.txt and upload it to your site’s root, so it opens at
/robots.txt. Check the address in your browser after uploading.
Try it yourself
Opens the robots.txt Generator & Tester with this tutorial's sample loaded.
Common mistakes
- Blocking Googlebot by accident
- Google-Extended controls use of your content in Google’s AI models; Googlebot is the search crawler. Don’t list Googlebot in the AI group unless you want to leave Google Search.
- Expecting it to work on every bot
- robots.txt is a request. Reputable companies honour it, but some scrapers ignore it. For stronger protection, use your host’s bot-blocking features.
- Uploading to a sub-folder
- Crawlers only read robots.txt at the root of the domain. A copy in /blog/ is ignored.
Next steps
Go back to the robots.txt Generator & Tester, or keep going with one of these:
FAQ
Will this remove my content from AI models that already used it?
No. It only affects future crawling.
Do I need to update the list?
New crawlers appear over time. Review the list now and then, using the names the AI companies publish.