Use this free robots.txt generator to create a robots.txt file for your website. Pick a starting point, add the paths you want crawlers to skip, link your sitemap, and the tool builds the file as you type. It checks the format, lets you test a path against your rules, and gives you a file you can copy or download. Everything runs in your browser, and nothing you enter is sent anywhere.
Robots.txt asks well-behaved crawlers to stay out of certain paths. It is not a security tool and it does not remove pages from search results. Never rely on it to hide private content.
How to use the robots.txt generator
- Choose a starting point: pick Allow all, Block all, WordPress, or Online store, or choose Custom to start from your own rules.
- Fill in the rules: list the paths to block and any paths to re-allow, one per line. Add your sitemap address, and choose whether to block common AI crawlers.
- Test a path: enter a path such as /wp-admin/options.php to see whether your rules allow or block it, and which rule decides.
- Fix any warnings: the tool flags paths without a leading slash, sitemap addresses that are not full URLs, and rules that could block your whole site.
- Copy or download: save the file as robots.txt and upload it to the root of your site, then test it in your search console.
What this tool does and does not do
This tool builds a robots.txt file from the values you enter and checks it against the path you test. It does not read your live robots.txt file, crawl your site, or check whether the paths you list actually exist. The path tester follows the rules for all crawlers and uses the longest matching rule, the same approach major search engines describe. Only crawlers that choose to follow robots.txt will respect the file.
Robots.txt directives at a glance
| Directive | What it does | Example |
|---|---|---|
| User-agent | Names the crawler that the rules below it apply to. An asterisk means all crawlers. | User-agent: * |
| Disallow | Asks crawlers not to visit a path. An empty value blocks nothing. | Disallow: /admin/ |
| Allow | Re-opens a path inside a blocked folder. | Allow: /admin/help/ |
| Crawl-delay | Asks a crawler to wait between requests. Some major search engines ignore it. | Crawl-delay: 10 |
| Sitemap | Points crawlers to your XML sitemap. Use a full address. | Sitemap: https://example.com/sitemap.xml |
| Wildcards | An asterisk matches any text, and a dollar sign matches the end of a URL. | Disallow: /*.pdf$ |
A blocked page can still appear in search results if other sites link to it. To keep a page out of search results, use a noindex tag and leave the page open to crawling so the tag can be seen.
Worked examples
Setting up a WordPress site
Choose WordPress to block the admin area and internal search pages while keeping admin-ajax.php open, which many themes and plugins need. Add your sitemap address, then copy the file.
Keeping a staging site out of search
Choose Block all to ask every crawler to stay away from the whole site. Remove this file before you launch, because leaving it in place is a common reason new sites are not crawled.
Opting out of AI crawlers
Set Block common AI crawlers to yes. The tool adds a group that disallows well-known AI training crawlers while leaving your rules for regular search engines unchanged.
Common robots.txt mistakes
- Blocking the whole site. A single Disallow: / line stops compliant crawlers from reading any page.
- Blocking CSS and JavaScript. Search engines need these files to render your pages.
- Using it to hide private pages. The file is public, so listing a path can point people to it.
- Putting the file in the wrong place. It must sit at the root, such as https://example.com/robots.txt.
- Using a relative sitemap address. Use the full address, starting with https://.
- Forgetting other hosts. Each subdomain and protocol needs its own robots.txt file.
- Ignoring case. Paths in robots.txt are case sensitive, so /Admin/ and /admin/ are different.
Frequently asked questions
What is a robots.txt file?
A robots.txt file is a plain text file at the root of a website that tells crawlers which paths they may or may not visit. Search engines read it before they crawl a site.
Where do I put the robots.txt file?
Upload it to the root of your domain so it loads at an address such as https://example.com/robots.txt. Each subdomain needs its own file.
Does robots.txt hide a page from search results?
No. It controls crawling, not indexing. A blocked page can still appear in results if other sites link to it. To keep a page out of search results, use a noindex tag and leave the page open to crawling so the tag can be seen.
Does robots.txt stop AI crawlers?
Only the ones that choose to follow it. Many well-known AI crawlers say they respect robots.txt, but the file cannot enforce anything. Crawler names also change, so review your list from time to time.
What does Crawl-delay do?
It asks a crawler to wait a number of seconds between requests. Some crawlers, such as Bing, follow it. Google ignores it.
Should I block CSS and JavaScript files?
Usually not. Search engines need these files to render your pages the way visitors see them, and blocking them can hurt how your pages are understood.
Is the Xornex Robots.txt Generator free?
Yes. The generator is free to use online, and you can copy or download the file without creating an account.
Is the information I enter stored?
No. The generator runs in your browser, and nothing you type is sent to a server.