Technical SEO

Free Robots.txt Generator

Create a robots.txt file in seconds. Start from a preset, allow or block search engines and AI crawlers like GPTBot, add your sitemap and custom rules, then copy or download the file.

  • Free
  • No sign-up
  • AI crawler presets
  • Runs in your browser

Your rules

Example loaded

Start from a preset

Presets replace your bot and path settings. "Block AI training bots" adds to them.

Site settings

Ignored by Google and Yandex. Bing reads it. Only set it if bots overload your server.
Adds Disallow /wp-admin/, Disallow /xmlrpc.php, Allow /wp-admin/admin-ajax.php for all bots.

Bot access

Search Engines
All Bots
Googlebot
Bingbot
YandexBot
DuckDuckBot
AI Crawlers
GPTBotOpenAI model training
ClaudeBotAnthropic model training
Google-ExtendedGemini training; does not affect Google Search
PerplexityBotPerplexity's search index
CCBotCommon Crawl, used by many AI models
BytespiderByteDance crawler
Applebot-ExtendedApple AI training; Applebot still crawls
SEO Tools
AhrefsBot
SemrushBot
MJ12bot
Social Bots
Facebot
Twitterbot

Custom Allow / Disallow rules

Your robots.txt

Groups8User-agent blocks
Rules11Allow + Disallow
Bots blocked77 AI crawlers
Size406 BGoogle reads 500 KiB
robots.txt
User-agent: *
Allow: /wp-admin/admin-ajax.php
Disallow: /wp-admin/
Disallow: /xmlrpc.php
Disallow: /?s=

User-agent: GPTBot
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: PerplexityBot
Disallow: /

User-agent: CCBot
Disallow: /

User-agent: Bytespider
Disallow: /

User-agent: Applebot-Extended
Disallow: /

Sitemap: https://www.example.com/sitemap.xml
Where to place this file: upload it to your website root at https://yoursite.com/robots.txt. Then check it in Google Search Console's robots.txt report, or with our robots.txt validator.

How to use the Robots.txt Generator

  1. 1

    Pick a starting point

    Choose a preset: allow all, block all, WordPress, Shopify, Next.js or block AI training bots. Add your sitemap URL.

  2. 2

    Set bots and paths

    Allow or block each crawler, then add Disallow and Allow rules for folders like /admin/ or /cart. The file updates as you go.

  3. 3

    Upload and test

    Copy or download robots.txt, upload it to the root of your site and check it in Search Console's robots.txt report.

Quick reference

Robots.txt rules Google follows

Source: Google: How Google interprets the robots.txt specification

Location
The root of the hosthttps://www.example.com/robots.txt. Each subdomain and protocol needs its own file.
Size limit
500 KiBGoogle ignores anything after the first 500 KiB.
Fields Google reads
user-agent, allow, disallow, sitemapOther fields are ignored.
Crawl-delay
Ignored by GoogleBing reads it; Google sets its own crawl rate, and Yandex stopped using it in 2018.
When rules conflict
The longest matching rule winsIf an Allow and a Disallow rule are equally long, the less restrictive Allow wins.
Caching
Up to 24 hoursChanges can take a day to apply. A 4xx error counts as "no robots.txt"; a 5xx error pauses crawling.

What is a robots.txt file?

A robots.txt file is a plain text file at the root of your site that tells crawlers which URLs they may fetch. Search engines like Googlebot and Bingbot read it before they crawl, and so do most AI crawlers such as GPTBot and ClaudeBot.

Use it to keep crawlers out of admin areas, cart and checkout pages, internal search results and endless filter URLs, so they spend their crawl budget on pages that matter. It is a set of requests, not a lock: well-behaved bots follow it, bad bots ignore it, and anyone can read the file.

Robots.txt syntax: User-agent, Disallow, Allow and Sitemap

A robots.txt file is made of groups. Each group starts with one or more User-agent lines and lists the rules for those crawlers. A crawler follows only the most specific group that names it, and falls back to User-agent: *.

DirectiveWhat it doesExample
User-agentNames the crawler the group applies to; * means all crawlersUser-agent: Googlebot
DisallowAsks the crawler not to fetch paths that start with this valueDisallow: /admin/
AllowLets the crawler fetch a path inside a blocked folderAllow: /admin/help/
SitemapGives the full URL of your XML sitemap; can go anywhere in the fileSitemap: https://www.example.com/sitemap.xml
Crawl-delayAsks for a pause between requests; Google ignores itCrawl-delay: 10

Paths are case-sensitive. * matches any run of characters and $ marks the end of the URL, so Disallow: /*.pdf$ blocks every PDF. An empty Disallow: allows everything, and Disallow: / blocks the whole site.

User-agent: *
Disallow: /admin/
Disallow: /cart
Disallow: /*?sort=
Allow: /admin/help/

Sitemap: https://www.example.com/sitemap.xml

How to block AI crawlers like GPTBot and ClaudeBot

To keep your content out of AI model training, give each AI crawler its own group with Disallow: /. The generator's "Block AI training bots" preset does this for the crawlers below while leaving Googlebot and Bingbot open.

User-agentCompanyWhat blocking it does
GPTBotOpenAIStops crawling for model training. ChatGPT search uses a different bot, OAI-SearchBot.
ClaudeBotAnthropicStops crawling for model training.
Google-ExtendedGoogleStops use of your content for Gemini training and grounding. It does not affect Google Search.
Applebot-ExtendedAppleStops use for Apple's AI training. Applebot still crawls for Siri and Spotlight.
CCBotCommon CrawlStops the open web archive many AI models are trained on.
PerplexityBotPerplexityRemoves your pages from Perplexity's search index, so it can no longer cite them.
BytespiderByteDanceAsks ByteDance's crawler to stay away; reports say it does not always obey.

Blocking AI search crawlers (such as PerplexityBot or OAI-SearchBot) can stop AI answers from citing and linking to you. Block training bots if you want to protect your content, but think twice before blocking the bots that send visitors.

Robots.txt examples for WordPress, Shopify and Next.js

WordPress. Keep the admin area out of the crawl but leave admin-ajax.php open, as WordPress does by default. Do not block theme or plugin files: Google needs CSS and JavaScript to render your pages.

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

Sitemap: https://www.example.com/sitemap_index.xml

Shopify. Shopify creates robots.txt for every store and blocks cart, checkout, account and admin pages for you. To add rules, edit the robots.txt.liquid template in your theme rather than uploading a file.

Next.js and headless sites. Put the file in public/robots.txt, or generate it from app/robots.ts. Block API routes, never /_next/, which holds your CSS and JavaScript.

User-agent: *
Disallow: /api/

Sitemap: https://www.example.com/sitemap.xml

Robots.txt vs noindex: blocking crawling is not blocking indexing

Disallow stops a crawler from fetching a page, but Google can still index the URL without its content if other pages link to it. It then shows up in results with no description.

To keep a page out of Google, let it be crawled and add <meta name="robots" content="noindex"> or an X-Robots-Tag: noindex header. If robots.txt blocks the page, Google never sees the noindex. For private content, use a password.

Where to put robots.txt and how to test it

  1. Save the file as robots.txt, plain text in UTF-8.
  2. Upload it to the root of your host, so it opens at https://www.example.com/robots.txt. A file in a subfolder is ignored.
  3. Open the URL in a browser to check it returns the file with a 200 status.
  4. In Google Search Console, open the robots.txt report to see the version Google fetched, and request a recrawl after big changes.
  5. Test important URLs with our robots.txt validator to see which rule allows or blocks them.
Keytomic logo

Catch crawl blocks before they cost you traffic.

Keytomic's technical SEO audit crawls your site and flags pages blocked by robots.txt, noindex tags, broken links, redirect chains and missing sitemaps, with a fix for each one.

  • 1ResearchTopics and keywords planned
  • 2WriteDrafts in your voice
  • 3PublishSent to your CMS
  • 4AuditIssues found weekly

FAQ

Robots.txt Generator questions,
answered.

Need this done for every page on your site? Talk it through with the team.

Book a demo
Do I need a robots.txt file?

Not always. Without one, crawlers assume they may crawl everything, which is fine for many small sites. Add one when you want to keep crawlers out of admin, cart or search pages, block AI crawlers, or point bots to your sitemap.

What should be in a robots.txt file?

At least a User-agent: * group and your Sitemap line. Then add Disallow rules for areas with no search value, such as /admin/, /cart and internal search, and separate groups for any crawlers you want to block, such as GPTBot.

Does Disallow keep a page out of Google?

No. Disallow stops crawling, not indexing. Google can still list a blocked URL if other pages link to it. Use a noindex meta tag or header on a crawlable page to keep it out of results.

How do I block AI crawlers like GPTBot and ClaudeBot?

Add a group for each one with Disallow: /, for example "User-agent: GPTBot" then "Disallow: /". The "Block AI training bots" preset adds GPTBot, ClaudeBot, Google-Extended, PerplexityBot, CCBot, Bytespider and Applebot-Extended. Robots.txt is voluntary, so a bot that ignores it is not stopped.

Does Google read Crawl-delay?

No. Google ignores Crawl-delay and adjusts its crawl rate by itself, based on how your server responds. Bing still reads it; Yandex stopped in 2018.

Where do I upload robots.txt?

To the root of your site, so it opens at https://yourdomain.com/robots.txt. Each subdomain needs its own file. On Shopify and Wix you edit it in the platform instead of uploading a file.

How big can a robots.txt file be?

Google reads up to 500 KiB and ignores the rest. Most files are under 1 KB; if yours is large, group paths with wildcards instead of listing every URL.

Is this robots.txt generator free?

Yes. It is free, unlimited and needs no sign-up. The file is built in your browser and nothing you enter is sent anywhere.

See all tools
Keytomic logo

Rank on Google and in AI search.
On autopilot.

Start your free trial
app.keytomic.com/acme.com/overview