Online admissions open for the SEO, PHP web development and networking & cybersecurity courses. Enquire for the next batch.

Robots.txt Generator

SEO tool Updated By the SkillNewton team

Use this generator to build a robots.txt file without remembering the syntax. Choose a default rule, add paths to block, set rules for individual crawlers, block or allow common AI crawlers and list your sitemaps. The file updates as you go, ready to copy or download and upload to the root of your site.

Robots.txt Generator

All crawlers (User-agent: *)

One path per line, starting with /. * matches any characters and $ marks the end of the URL. Ignored when everything is disallowed.

Googlebot ignores crawl-delay. Some other crawlers, such as Bingbot, respect it.

Rules for specific crawlers

A crawler that has its own group follows only that group and ignores the * rules, so repeat any paths it should also avoid.

AI crawlers

OpenAI crawler for training data.

Anthropic crawler for training data.

Google token for Gemini training and grounding; does not affect Google Search.

Perplexity crawler for its search index.

Common Crawl, an open dataset widely used for AI training.

Blocking only works for crawlers that choose to follow robots.txt.

Full URLs, one per line.

robots.txt controls crawling, not indexing. A blocked URL can still appear in search results if other pages link to it. To keep a page out of Google, allow crawling and add a noindex meta tag or header instead.

Upload the file to the root of your host, e.g. https://www.example.com/robots.txt. Each subdomain needs its own file.

Runs in your browser. Nothing you enter is uploaded or saved.

How to use this tool

  1. Choose the default. Allow all crawling for a normal site, or disallow all for a staging site that is also password-protected.
  2. Add paths and rules. List paths to block for every crawler, then add rules for specific user-agents if needed.
  3. Set AI crawlers and sitemaps. Block or allow AI crawlers individually and add the full URL of each XML sitemap.
  4. Download and upload. Download robots.txt, upload it to the root of your domain and test it in Google Search Console.

What robots.txt does (and does not do)

robots.txt tells well-behaved crawlers which URLs they may fetch. It does not stop a page being indexed: a blocked URL can still appear in results if other pages link to it. To keep a page out of Google, let it be crawled and use a noindex meta tag or X-Robots-Tag header.

How crawlers pick a group

A crawler follows the most specific User-agent group that matches it and ignores the rest. If you add a group for Googlebot, it no longer reads the * rules, so repeat any paths it should still avoid. When Allow and Disallow rules conflict, Google uses the most specific (longest) matching rule.

Blocking AI crawlers

GPTBot (OpenAI), ClaudeBot (Anthropic), PerplexityBot and CCBot (Common Crawl) can be blocked by name. Google-Extended is a control token: blocking it limits use of your content for Gemini, without affecting Google Search. Crawlers that ignore robots.txt need server-level blocking instead.

Crawl-delay and sitemaps

Googlebot ignores Crawl-delay; some other crawlers respect it. Sitemap lines must use full URLs and can sit anywhere in the file. Listing sitemaps here helps search engines find them even without Search Console.

Frequently asked questions

Where does robots.txt go?

At the root of each host, e.g. https://www.example.com/robots.txt. A file in a subfolder is ignored, and each subdomain needs its own file.

Should I block CSS and JavaScript files?

No. Google needs them to render pages properly. Blocking them can make pages look broken to Google.

Will blocking a page remove it from Google?

Not reliably. Use noindex on a crawlable page, or the Removals tool in Search Console for urgent cases, then block crawling later if you need to.

Is robots.txt a security measure?

No. The file is public and only polite crawlers obey it. Protect private areas with authentication, and avoid listing secret paths in it.

Want to Learn This Properly?

The Technical SEO & Website Optimization (Online) turns resources like this into practised skills, with projects on real websites.

WhatsApp Call Us Now

Free counselling

Send an Enquiry

Tell us which course you are interested in. We reply by email or phone with the next batch and how to enrol.

We reply by email or phone within working hours. No spam.