robots.txt generator
What is a Robots Txt Generator?
The robots.txt file at the root of a website tells search engine crawlers and other bots which paths they may crawl. It is one of the first files Googlebot requests. This generator builds a correctly formatted file from per-bot rules and sitemap URLs.
How to use it
- Add a group for all crawlers (
*) and, if needed, specific bots such as Googlebot or GPTBot. - Add Allow and Disallow paths to each group.
- Add your sitemap URLs.
- Save the result as
robots.txtat the root of your domain, for examplehttps://example.com/robots.txt.
Example
User-agent: *
Disallow: /admin/
Disallow: /cart
Allow: /
User-agent: GPTBot
Disallow: /
Sitemap: https://example.com/sitemap.xmlSyntax rules
- Paths are case-sensitive and match by prefix:
Disallow: /adminalso blocks/administrator. *matches any characters and$anchors the end:Disallow: /*.pdf$blocks PDF files.- When Allow and Disallow conflict, Google applies the most specific (longest) matching rule.
- Googlebot ignores
Crawl-delay; Bing and some others respect it.
Critical mistakes to avoid
- robots.txt does not remove pages from Google. A blocked URL can still be indexed if other sites link to it. To keep a page out of search results, allow crawling and add a
noindexmeta tag. - Do not block redirecting or canonicalised URLs. Google must crawl them to see the redirect or canonical.
- Do not block CSS and JavaScript. Google needs them to render pages.
- It is not security. Anyone can read robots.txt, so do not list secret paths.
- A leftover
Disallow: /from staging can deindex an entire site.
Frequently Asked Questions
Does robots.txt stop a page from being indexed?
No. It only stops crawling. To keep a page out of search results, allow crawling and use a noindex meta tag or header.
Where must robots.txt be placed?
At the root of the host, such as https://example.com/robots.txt. Each subdomain needs its own file.
How do I block AI crawlers?
Add groups for their user agents, such as GPTBot, ClaudeBot or Google-Extended, with Disallow: /.
Does Google respect Crawl-delay?
No. Googlebot ignores Crawl-delay. Use Search Console settings or server responses to manage crawl rate.