Robots.txt Generator
Build a clean robots.txt file to guide search engine crawlers
What the Robots.txt Generator Does
A robots.txt file is a small text file at the root of a website that tells automated crawlers which parts of the site they may visit. The Robots.txt Generator on WebTOOLkt helps you write one without memorising the syntax. Choose which crawlers the rules apply to, list the folders or files you want to keep them out of, add your sitemap address and copy the finished file.
It is designed for site owners, bloggers, developers and SEO specialists who need a correct file quickly, especially after launching or restructuring a website.
How to Use the Robots.txt Generator
- Select a default rule: allow all crawlers or block certain areas.
- Add paths you want crawlers to avoid, such as admin pages, internal search results or temporary folders.
- Enter your XML sitemap address so crawlers can find it easily.
- Add rules for specific crawlers if you need them.
- Generate the file and copy the text.
- Save it as robots.txt in plain text and upload it to the root of your domain, for example https://example.com/robots.txt.
- Open the address in a browser to confirm it displays correctly.
The Basic Syntax
A robots.txt file is made of groups of simple lines:
- User-agent: names the crawler the following rules apply to. An asterisk means all crawlers.
- Disallow: a path the crawler should not request.
- Allow: a path that may be crawled even inside a disallowed folder.
- Sitemap: the full address of your XML sitemap.
The standard behind these rules is described in RFC 9309, and Google explains how it reads the file in its robots.txt introduction and in its guide to creating a robots.txt file.
What Robots.txt Can and Cannot Do
- It manages crawling. It asks well-behaved bots not to request certain URLs, which saves server resources and focuses crawl effort on important pages.
- It does not guarantee privacy. The file is public, and rude bots can ignore it. Never use it to hide sensitive data. Use passwords or server-side restrictions instead.
- It does not reliably remove pages from search. A blocked URL can still appear in results if other sites link to it. To keep a page out of the index, allow crawling and use a noindex directive, as explained in Google's guide to blocking indexing.
- It applies per host. Each subdomain needs its own file.
Common Mistakes That Can Hurt a Site
- Blocking everything. A line that disallows the root path stops all crawling. This is the classic accident after a staging site goes live.
- Blocking CSS and JavaScript. Search engines need these files to render pages properly.
- Wrong location. The file must sit at the root of the domain, not in a subfolder.
- Wrong file name or format. Use lower-case robots.txt in plain text with UTF-8 encoding.
- Forgetting the sitemap line. It is optional but helpful.
- Using it instead of noindex. The two do different jobs.
Google also reads only a limited size of the file, so keep it short and tidy.
Testing and Maintaining Your File
- After uploading, open the file in your browser to make sure it loads.
- Use the robots.txt report in Google Search Console, introduced at Search Console, to confirm Google can fetch and read it.
- Test important URLs with the URL Inspection tool to see whether they are blocked.
- Review the file after every redesign, migration or CMS change.
- Keep a copy of the previous version so you can restore it if needed.
Why Use This Tool Instead of Other Options
Writing robots.txt by hand is easy to get wrong, and one stray character can block an entire site. The Robots.txt Generator produces clean, correctly formatted rules from simple choices. It is free and does not require an account. Together with the Meta Tag Generator, Google Index Checker and Website Audit Tool on WebTOOLkt, it covers the main steps of controlling how search engines crawl and index your pages.
Related WebTOOLkt Tools
- Google Index Checker to see whether pages are indexed.
- Meta Tag Generator to create robots and other meta tags.
- Meta Tags Analyzer to inspect existing meta tags.
- HTTP Status Code Checker to confirm your robots file returns a success status.
- Htaccess Redirect Generator to build server redirect rules.
- Website Audit Tool for a wider technical check.
Useful External Resources
- Google: Introduction to robots.txt
- Google: Create a robots.txt file
- RFC 9309: Robots Exclusion Protocol
Frequently Asked Questions
Do I need a robots.txt file?
Not always. Without one, crawlers assume they may visit everything. A file is useful when you want to guide crawling.
Will robots.txt hide a page from Google?
Not reliably. Use noindex or authentication for pages that must stay out of search.
Where do I upload the file?
In the root directory of your domain, so it loads at yourdomain.com/robots.txt.
Can I block just one search engine?
Yes. Add a group naming that crawler's user-agent and set the rules for it.

