A robots.txt file is a short text file that tells search engines and other crawlers which parts of your site they may visit. Writing it by hand is easy to get wrong: one stray / can block your whole website. Our free Robots.txt Generator builds the file from presets and plain choices, checks it as you go and lets you test any path before you upload anything.
This guide walks through every control on the page, shows the exact file it produces, and explains the mistakes people make most often. It is written for site owners, bloggers, shop owners and developers who want a correct file without learning the syntax first.
What Robots.txt Generator does
You choose what crawlers may do, and the tool writes the matching User-agent, Allow, Disallow, Crawl-delay and Sitemap lines. It then reads its own output back with the same parser used by our Robots.txt Tester and either says "Valid robots.txt: no problems found." or lists each problem with its line number.
It can also tell you whether a given crawler may open a given path under the rules you have just built, so you see the effect of a rule before it goes live.
What it does not do: it does not upload the file for you, it does not read your live site, and it does not hide pages. Robots.txt asks well-behaved crawlers to stay away. Anyone can still open a blocked URL in a browser, and a blocked page can remain in Google if other sites link to it.
How to use Robots.txt Generator, step by step
- Open Robots.txt Generator.
- In "Start from a preset", press the button closest to what you need: Allow everything, Block AI crawlers, Block admin & private paths, WordPress or Block everything (staging site).
- Under "Rules for all crawlers", check the Default switch, then type the paths you want to block, one per line, in "Block these paths".
- Add exceptions in "But allow these (optional)" if a blocked folder contains a file crawlers still need.
- Tick "Block AI crawlers" if you want to keep AI training and AI answer bots out.
- Add your sitemap address in "Sitemap URLs".
- Read the validator under the file. Use "Test a path" to try a few real URLs.
- Press Copy or Download (the file is saved as
robots.txt), then upload it to your site's root folder.
The preview updates on every keystroke, so you never need to press a "generate" button.
Every option explained
Presets
A preset fills in the form for you, and you can keep editing afterwards. A preset that has its own paths replaces the text in the path boxes, so apply presets first and type your own rules after. "Block AI crawlers" is the gentle one: it only ticks the AI option and leaves your paths alone. "Allow everything" and "Block everything (staging site)" empty the path boxes and untick the AI option.
| Preset | What it sets |
|---|---|
| Allow everything | Default "Allow crawling", no blocked paths, no AI blocking |
| Block AI crawlers | Ticks "Block AI crawlers" and leaves your paths alone |
| Block admin & private paths | Blocks /admin/, /login, /account/, /cart/, /checkout/, /search and /cgi-bin/ |
| WordPress | Blocks /wp-admin/, /?s= and /search/, and allows /wp-admin/admin-ajax.php |
| Block everything (staging site) | Default "Block everything", so every search engine is asked to stay away |
Default: Allow crawling or Block everything
"Allow crawling" is for a normal public site. "Block everything" writes Disallow: / and hides the path boxes, with a warning that it is meant for staging or private sites only. Use it on a test copy of your site, and remember to switch it off for the real launch. Forgetting this is one of the most common reasons a new site never appears in Google.
Block these paths
One path per line. A path that does not start with / or * gets a / added for you, duplicates are removed and blank lines are ignored. A few things to know:
- A trailing slash blocks the whole folder:
/admin/covers everything inside it. - Rules match from the start of the URL, so
/searchalso blocks/search?q=eidand/searching-tips. Add the slash if you only mean the folder. *matches any run of characters, and$at the end means "the URL ends here"./*.pdf$blocks URLs that end in .pdf.- Paths are case-sensitive.
/Admin/and/admin/are different.
But allow these (optional)
These are exceptions inside blocked folders. The WordPress preset uses it for /wp-admin/admin-ajax.php, which some themes and plugins call from public pages. In the generated file, Allow lines are written before Disallow lines. Order does not matter to Google, which picks the longest matching rule.
Block AI crawlers
This adds one group listing 16 crawlers with Disallow: /. The list is GPTBot, ChatGPT-User, OAI-SearchBot, ClaudeBot, Claude-User, anthropic-ai, Google-Extended, Applebot-Extended, CCBot, PerplexityBot, Bytespider, Meta-ExternalAgent, Amazonbot, cohere-ai, Diffbot and ImagesiftBot. For the full story, including who should and should not tick it, read how to block AI crawlers like GPTBot with robots.txt.
Crawl-delay (seconds)
An optional number from 0 to 60, written under the "all crawlers" group. Bing and Yandex slow down when they see it; Google ignores it. Because of that, the checker shows a note whenever you use it. Leave it empty unless your server genuinely struggles with crawler traffic.
Sitemap URLs
One full address per line, such as https://example.com/sitemap.xml. If a line does not start with http:// or https:// followed by a domain, the tool warns you and tells you which line is wrong. A bare domain such as https://example.com is accepted, the same as in the Robots.txt Tester. You can make the sitemap itself with the Sitemap Generator.
Test a path
Pick a crawler (Googlebot, Bingbot, GPTBot, ClaudeBot or "Any other crawler"), type a path or a full URL, and the tool shows Allowed or Blocked together with the rule and line that decided it. If nothing matches, it says "no rule matches, so crawling is allowed".
What the generated file looks like
With the WordPress preset and one sitemap line, the tool writes this:
User-agent: *
Allow: /wp-admin/admin-ajax.php
Disallow: /wp-admin/
Disallow: /?s=
Disallow: /search/
Sitemap: https://example.com/sitemap.xml
Test /wp-admin/options.php and the result is Blocked by "Disallow: /wp-admin/" (line 3). Test /wp-admin/admin-ajax.php and it is Allowed by line 2, because the Allow rule is longer and more specific than the Disallow rule. Test /blog/my-first-post and no rule matches, so it is allowed.
If you tick "Block AI crawlers" as well, a commented group of 16 User-agent lines and one Disallow: / is placed at the top, and the group for everyone else follows it.
What it accepts and its limits
- Paths: any text, one per line. Entries are trimmed, and a missing leading
/is added. - Crawl-delay: whole seconds between 0 and 60.
- Output: a plain
robots.txttext file that always ends with a line break. - Groups: one group for all crawlers (
User-agent: *) and, if ticked, one group for AI crawlers. There are no per-crawler boxes for Googlebot or Bingbot; if you need those, copy the output and add a group by hand, then paste the result into the Robots.txt Tester to check it. - Google reads only the first 500 KiB of a robots.txt file, which is far more than this tool will ever produce.
Privacy
Everything happens in your browser. The rules you type, the sitemap addresses and the paths you test are not sent to our server. The only network step is the one you do yourself: uploading the file to your own site.
Tips to work faster
- Start from a preset even if you will change most of it. It gets the syntax right.
- Before you launch an online shop, block the pages that make no sense in search: cart, checkout, account and internal search results.
- Put the full sitemap address in the file. Search engines that read robots.txt, not only Google, will find it without a manual submission.
- Test your most important page types (home page, a product page, a blog post) in "Test a path" before you upload.
- After uploading, open
https://yoursite.com/robots.txtin your browser to confirm it loads as plain text, then run the live address through the Tester.
Common problems and how to fix them
"Sitemap lines need a full URL starting with https:// or http://"
A sitemap entry such as /sitemap.xml is not enough. Write the complete address including the domain.
The whole site is blocked after launch
You are probably still using "Block everything" or the staging file. Generate a new file with "Allow crawling", upload it over the old one and check /robots.txt again.
A blocked page still shows up in Google
Robots.txt controls crawling, not indexing. If you want the page gone from search results, allow crawling and add a noindex tag to the page. Our Meta Tag Generator can write the tag.
A rule blocks more than you meant
Rules are prefix matches. /product blocks /products and /product-reviews as well. Add a trailing slash, or use $ for exact endings, then re-test.
The warning "Crawl-delay is ignored by Google"
This is not an error. Remove the line if you do not need it for Bing or Yandex.
Related tools
- Robots.txt Tester: fetch a live robots.txt, or paste one, and test URLs against any crawler.
- Sitemap Generator: build the sitemap.xml that your Sitemap line points to.
- XML Sitemap Validator: check a sitemap before you submit it.
- SEO Tools: the rest of our SEO utilities.
Quick checklist
- Start from the closest preset.
- Block folders with a trailing slash.
- Never leave "Block everything" on a live site.
- Add the full sitemap URL.
- Test real pages, upload to the root, then check the live file.



