About the Robots.txt Generator
A robots.txt file tells crawlers which parts of your site they may visit. This Robots.txt Generator starts from a template, such as WordPress or blocking AI crawlers, lets you set rules for each crawler, and writes a clean file you can copy or download.
How it works
The file starts with a User-agent line using the value you enter; * means the rules apply to all crawlers. Each non-empty line in the Allow box becomes an Allow: line, followed by each non-empty line in the Disallow box as a Disallow: line.
If a sitemap URL is entered, a blank line and a Sitemap: line are added at the end. The tool starts with sensible example values, disallowing /admin/ and /private/ for all user-agents and listing an example sitemap, which you can edit or clear.
How to use
- 1
Pick a template to start from.
- 2
Adjust the User-agent, Allow and Disallow paths, or add groups for other crawlers.
- 3
Enter your Sitemap URLs.
- 4
Copy or download the file and save it as robots.txt in your site's root folder. Copy link saves the draft with all its rules.
Worked examples
The default setup
Blocking admin and private folders for all crawlers.
Block a folder but allow one file in it
A WordPress site that blocks wp-admin but needs admin-ajax.php reachable.
Google applies the most specific matching rule, so the longer Allow path wins for that one file.
Frequently asked questions
Where does robots.txt need to be placed?+
At the root of your domain, for example https://yoursite.com/robots.txt. Crawlers do not look for it in subfolders, and each subdomain needs its own file.
Does robots.txt prevent a page from appearing in search results?+
Not necessarily. It blocks crawling, but a blocked URL can still be indexed if it is linked from elsewhere. Use a noindex meta tag to keep a page out of results.
What does User-agent: * mean?+
The asterisk applies the rules to all crawlers. Enter a specific name, such as Googlebot or Bingbot, to target one bot.
Should I add my sitemap to robots.txt?+
Yes. A Sitemap line helps all search engines find your sitemap, even ones where you have not submitted it manually.
What if both Allow and Disallow match a URL?+
Google and Bing apply the most specific rule, meaning the one with the longest matching path. If they are equally specific, Allow wins.