Table of Contents
What a robots.txt File Does
A robots.txt file gives crawling instructions to compliant bots for URLs on one host. It is normally placed at the root of a site, such as https://www.example.com/robots.txt. A Disallow rule asks a crawler not to request matching paths; it is not access control and does not guarantee that a URL already known to a search engine will disappear from search results.
Do not use robots.txt to protect private information. Use authentication for private content. If you need a page removed from search, allow crawling so a search engine can see a page-level noindex directive, or use the appropriate removal process.
How to Use the Robots.txt Generator
- Choose whether the generated file should allow all crawlers. If you turn this off, the generated file includes a site-wide
Disallow: /rule. - Enter only paths you intend to disallow, one per line, such as
/private/. Review each path carefully because rules can affect important pages and resources. - Enter the absolute URL of your XML sitemap, review the preview, then copy or download the file.
- Place the finished file at the root of the correct host and test the live
/robots.txtresponse after publishing.
This generator creates a general User-agent: * group with an allow-all option, disallow paths, and a sitemap line. It does not create per-bot rules or custom Allow directives.
Example Robots.txt File
For a site that allows normal crawling but asks bots to skip a private path, a basic file could look like this:
User-agent: *
Disallow: /private/
Sitemap: https://www.example.com/sitemap.xmlReplace the example sitemap address with your own final, canonical sitemap URL. Do not copy a sample disallow path without checking whether your site uses it.
Check the Live File Before Relying on It
After uploading the file, open https://your-domain.example/robots.txt and check that it returns the intended plain text. Confirm the hostname, HTTPS version, sitemap URL, and every disallowed path. Also check that pages you want indexed are not blocked, and remember that a robots.txt rule is a crawl instruction—not a canonical tag or a noindex directive.
For a practical walkthrough of directives and common mistakes, read our robots.txt SEO guide.
Frequently Asked Questions
Where should robots.txt be placed?
Place it at the root of the relevant host, for example https://www.example.com/robots.txt. Each hostname can have its own robots.txt file.
Does robots.txt remove a page from Google?
No. It controls crawling by compliant bots, not guaranteed index removal. A blocked URL may still appear in search results if discovered elsewhere.
Can I use robots.txt to protect private pages?
No. Robots.txt is public and is not access control. Protect private pages with authentication.
What does this generator create?
It creates a general User-agent: * group, an allow-all option, disallow paths, and a sitemap line. Review the preview before publishing.
