Free Robots.txt Generator & Tester
Use this free robots.txt generator & tester to control crawl access, block bad bots and protect staging environments.
Generating…
Your robots.txt
What It Does
Builds a robots.txt file from your Allow rules, Disallow rules and sitemap address, then flags risky settings such as blocking the whole site.
What is robots.txt?
robots.txt is a plain-text file placed at the root of your website (e.g. https://yoursite.com/robots.txt). It tells search-engine crawlers which parts of the site they may or may not request. It is not a security mechanism—malicious bots can ignore it—but legitimate crawlers such as Googlebot respect it.
Primary purpose
Manage crawl budget, hide non-public sections, and point crawlers to your sitemap.
Important limit
robots.txt prevents crawling, not indexing. A blocked URL can still appear in search if linked from elsewhere.
Where it lives
Must be at the domain root over HTTP/HTTPS. Subfolder robots.txt files are ignored.
Best practices
- Never block CSS, JS or image assets that Google needs to render the page.
- Do not use robots.txt to hide private pages that contain sensitive data—use authentication instead.
- Keep the file small and readable; comments start with
#. - After changes, request a recrawl in Search Console if critical pages were previously blocked.
How to Use It
- List any paths you want explicitly allowed (rarely needed unless you also block broader paths).
- List paths to disallow—admin areas, cart, checkout, internal search results, staging folders, etc.
- Optionally paste your sitemap URL.
- Generate, then Copy or Download the file and upload it as
/robots.txt. - Test with Google Search Console’s robots.txt tester.
Worked Example
Input
Allow: / Disallow: /wp-admin/ Sitemap: https://example.com/wp-sitemap.xml
What you get
User-agent: * Allow: / Disallow: /wp-admin/ Sitemap: https://example.com/wp-sitemap.xml
FAQs
Can I block an entire site?
User-agent: * Disallow: /. Use this only for staging or development environments, never on a live site you want indexed.