robots.txt Generator: Build Your File in a Minute
Pick a preset, add your own rules and sitemap, and copy a valid robots.txt ready to upload.
Start from a preset
Rule presets replace your rules; AI presets only change the AI crawler list below.
Rules
AI crawlers
Allowed bots get their own group with the same rules as User-agent: *, because a crawler follows only the most specific group that names it. “Not set” leaves the bot to the * rules.
AI search
Finds and cites your pages in AI answers
User-triggered
Opens a page when someone asks an assistant about it
AI training
Collects content to train AI models
Sitemaps and crawl rate
Added to every group above. Google ignores it; Bing and Yandex respect it.
Runs entirely in your browser — nothing you type is sent to our servers.
Upload it to the root of your domain, e.g. https://example.com/robots.txt — it only applies to that host and protocol.
robots.txt tells crawlers which parts of your site they may fetch. Most sites need only a few lines, but those lines must be exactly right: one misplaced slash can block the whole site, and AI crawlers now add a new decision about training bots versus AI search bots.
This robots.txt generator builds the file from presets — allow all, block admin areas, block or allow AI training bots, allow AI search bots — plus your own custom rules and sitemap lines. Everything happens in your browser, with no signup and no cost.
How to create a robots.txt file
Pick a starting preset
Start from “allow all” or “block admin areas”, then decide how to treat AI training and AI search bots.
Add rules and sitemaps
Add custom Disallow or Allow paths for specific crawlers, plus your sitemap URL.
Copy, upload and test
Save the result as robots.txt in your site’s root folder, then test key URLs before relying on it.
Anatomy of a robots.txt file
# Default rules for all crawlers
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: /cart/
Disallow: /*?sessionid=
Sitemap: https://example.com/sitemap.xml
User-agentstarts a group and names the crawler;*means any crawler without a group of its own.DisallowandAllowtake a path starting with/. Paths are case-sensitive prefix matches, with*and$as wildcards.Sitemaptakes a full URL and isn’t tied to any group.- The file is plain UTF-8 text named
robots.txtin lowercase, at the root of the host:https://example.com/robots.txt.
The “allow all” preset is the simplest file there is. Both of these mean “crawl everything”, and so do an empty file or no file at all:
User-agent: *
Disallow:
User-agent: *
Allow: /
Note the difference one character makes: Disallow: with nothing after it allows everything, while Disallow: / blocks everything. Google’s guide to creating robots.txt covers the format in full; our robots.txt entry explains the basics.
Choosing an AI bot policy
AI crawlers come in three kinds, and the presets treat them separately:
- AI search bots —
OAI-SearchBot,Claude-SearchBot,PerplexityBot— index pages so AI answers can cite and link to them. Blocking them can remove you from those answers. - User-triggered fetchers —
ChatGPT-User,Claude-User,Perplexity-User— read a page when a person asks about it. OpenAI notes that robots.txt may not apply to these requests. - Training bots and tokens —
GPTBot,ClaudeBot,CCBot, plusGoogle-Extended(Gemini training and grounding) andApplebot-Extended.
A common middle ground allows AI search and blocks training:
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
User-agent: Google-Extended
User-agent: Applebot-Extended
Disallow: /
User-agent: *
Disallow: /wp-admin/
Search bots aren’t named here, so they follow the * group. Blocking Google-Extended doesn’t affect Google Search or AI Overviews. See how your live file treats each bot with the AI crawler checker, and read about the AI crawler landscape.
Common robots.txt mistakes
Disallow: /underUser-agent: *blocks every compliant crawler from the whole site — a frequent leftover when a staging site goes live.- Blocking CSS and JavaScript folders that Google needs to render your pages.
- Using robots.txt to hide pages from search. Blocked URLs can still be indexed from links; use
noindexon a crawlable page instead. - Forgetting that named groups ignore
*. If you add aGooglebotgroup, repeat the rules it should still follow. - Relative sitemap URLs such as
Sitemap: /sitemap.xml; use the full address.
After uploading, test real URLs with the robots.txt tester and make sure the sitemap you reference is valid with the sitemap validator.
Tips for a safe robots.txt
- Start minimal; every line you add is a rule you must remember when the site changes.
- Block internal search results and endless filter combinations if they create thousands of near-duplicate URLs — that is where robots.txt saves crawl budget.
- Keep the file under 500 KiB; Google ignores anything beyond that limit.
- Review your AI bot choices once or twice a year, because new crawlers appear and companies split or rename their bots.
- Protect staging sites with a password rather than “Disallow: /”, so the rule can never travel to production.
Limits to keep in mind
The generator writes rules from your choices; it can’t see your site, so it won’t know if a blocked path contains pages you want indexed. robots.txt is voluntary — it guides well-behaved crawlers but blocks nobody by force, so use authentication or firewall rules for that. You upload the file yourself; then test it with the robots.txt tester.
Last updated Oct 30, 2026 by the Yes SEO team.
robots.txt Generator: frequently asked questions
Where do I upload robots.txt?
To the root of your host, so it loads at https://yourdomain.com/robots.txt. Each subdomain needs its own file, and a robots.txt in a subfolder is ignored.
What is the best robots.txt for SEO?
For most small sites, a short file that allows everything except admin or cart areas and lists the sitemap. Block more only when you have a clear reason, such as endless filter URLs.
How do I block AI bots with robots.txt?
Add a group naming the bots, such as GPTBot, ClaudeBot and CCBot, with “Disallow: /”. Decide separately about AI search bots like OAI-SearchBot, because blocking them can remove you from AI search answers.
Can robots.txt stop Google from indexing a page?
It stops crawling, not indexing. To remove a page from results, let Google crawl it and add a noindex meta tag or X-Robots-Tag header.
Do I need a robots.txt file at all?
No. Without one, crawlers assume they may fetch everything, and a missing file (404) is fine. Add one when you need to block areas or want to list your sitemap.