Search engines send crawlers to your site, and a robots.txt file tells them which pages they may visit and which they should leave alone. A small file at the root of your domain controls the crawl of your whole site, so getting it right saves crawl budget and keeps private pages out of search results.
This free generator builds the file for you in your browser. Pick a user-agent, tick the paths to block, add your sitemap, and copy the result. Test the finished file with the Robots.txt Tester (Paste), and check your sitemap itself with the XML Sitemap Validator (Paste) before you upload it.
How to use
- Choose a user-agent, or leave the default star to apply the rules to every crawler.
- Tick the common paths to block, such as the admin area and search pages, and add any extra paths one per line.
- Add your sitemap URL and an optional crawl-delay, then click Generate robots.txt.
- Review the file, then use Copy or Download robots.txt to save it for upload to your site root.
Why use Toolsvine
Most robots.txt generators run on a server and ask for your domain first. This one builds the file locally in your browser, so your site structure never leaves your device, and there is no account, no email capture and no waiting. The output follows the standard syntax every major crawler understands, and you can edit the rules and regenerate as often as you like.
What does a robots.txt file actually do?
A robots.txt file is a set of instructions that lives at the root of your domain, for example example.com/robots.txt, and every crawler reads it before it starts crawling. Each rule names a user-agent, such as Googlebot or all crawlers, and then lists paths to allow or disallow, so the crawler knows which parts of your site it may request.
It controls crawling, not indexing directly. A disallowed page can still appear in search results if other sites link to it, because Google may show the URL without crawling its content. To keep a page out of the index entirely, use a noindex robots meta tag instead, and use robots.txt for crawl management: admin areas, internal search results, cart and checkout pages, and staging copies that should never be crawled at all.
Which pages should you block, and which should you leave alone?
Block pages that waste crawl budget or expose private functions: admin and login areas, internal search result pages, shopping carts, checkout flows, account pages, and filtered category pages that create near-infinite URL combinations. Leave everything a visitor should find through search alone, including all product, article and category pages, plus the CSS, JavaScript and image files that render them.
Blocking CSS or JavaScript is the classic beginner error, because Google needs those files to render the page the way a visitor sees it. Another error is disallowing the whole site during a redesign and forgetting to remove the rule, which can quietly drain traffic for weeks. Always re-check the live file after a launch, and never use robots.txt to hide a page that other sites already link to.
Worked example: a small bookstore in Austin
Lone Star Books in Austin, Texas, runs an online store with an admin area, a search page, a cart and a checkout flow. The owner wants Google to crawl every book page but never the admin area, the search results or the checkout, and wants the sitemap listed at the bottom. The file below is exactly what the generator produces.
User-agent: * Disallow: /wp-admin/ Disallow: /search? Disallow: /cart/ Disallow: /checkout/ Allow: /wp-admin/admin-ajax.php Sitemap: https://lonestarbooks.example.com/sitemap.xml
The Allow line for admin-ajax.php is the one detail beginners miss: many sites need that file for live features, so blocking the whole admin folder without the exception can break the front end. The sitemap line points crawlers at the full URL list, which is the single most useful line in the file for a small site.
| Rule | What it does |
|---|---|
| User-agent: * | Applies the rules to every crawler |
| Disallow: /wp-admin/ | Keeps the admin area out of the crawl |
| Disallow: /search? | Blocks internal search result pages |
| Disallow: /cart/ and /checkout/ | Keeps cart and checkout out of search |
| Sitemap: .../sitemap.xml | Points crawlers at the full URL list |
What mistakes should I avoid with robots.txt?
The most damaging mistake is a blanket Disallow: / on a live site, which tells every crawler to stop entirely and can remove a site from search within days. The second is the opposite: assuming robots.txt hides a page from search, when it only stops the crawl and leaves the URL visible if it is linked elsewhere.
Other common slips are typos in paths, a missing trailing slash that blocks far more than intended, and a robots.txt file that is not actually at the domain root, where crawlers never look for it. Keep the file small and readable, put one rule per line, and test it after every change.
Frequently asked questions
Where does the robots.txt file go on my site?
It goes at the root of your domain, so it is reachable at yourdomain.com/robots.txt. A file buried in a subfolder is never read by crawlers, no matter how correct its contents are. Upload it to the same place as your homepage file, then open the URL in a browser to confirm it loads as plain text.
Does blocking a page in robots.txt remove it from Google?
Not on its own. Robots.txt stops the crawl, but Google can still list a URL in search results if other pages link to it, showing the address without a description. If you want a page gone from the index, use a noindex robots meta tag and leave the page crawlable so Google can see the tag.
What is the difference between Disallow and noindex?
Disallow is a crawl instruction in robots.txt that says do not visit this path. Noindex is a page-level instruction, usually a meta tag, that says do not show this page in search results. Disallow manages crawler effort, while noindex manages the index, and for a page you want hidden you normally need noindex rather than a disallow.
Should I block my CSS and JavaScript files?
Almost never. Google renders pages the way a visitor sees them, and that rendering needs your style sheets and scripts. Blocking them can make Google misunderstand your layout and can hurt your rankings, even though the text itself is still crawlable. Leave CSS, JavaScript and ordinary images allowed unless you have a specific privacy reason.
Do I need a crawl-delay, and what value should I use?
Most small sites never need one. A crawl-delay tells a crawler to wait between requests, which is only useful if your server is slow or very busy and crawlers are overloading it. If you do use one, one or two seconds is plenty, and note that Googlebot ignores crawl-delay entirely, so it only affects some other crawlers.