Skip to main content
Free SEO Tool

Robots.txt Generator

Build a valid robots.txt with crawl-delay, sitemap, and per-bot allow/disallow rules.

  • Free · no sign-up
  • Instant results
  • Privacy-friendly

Other SEO Tools

What robots.txt controls — and what it does not

robots.txt is a plain text file at the root of your domain that tells crawlers which paths they may request. Build your rules here, download the file, and upload it so it is reachable at yourdomain.com/robots.txt. It must live at the root — a file at /files/robots.txt is ignored entirely.

The critical distinction, and the source of most robots.txt mistakes, is that it controls crawling, not indexing. Disallow tells a crawler not to fetch a page. It does not tell a search engine to keep that page out of its results. If other sites link to a disallowed URL, Google can still index it from those links alone — which produces the familiar bare listing with no description and the note that no information is available for this page.

The trap: never Disallow a page you want de-indexed

To remove a page from search results you need a noindex directive, delivered either as a meta robots tag in the page's HTML or an X-Robots-Tag HTTP header. But a crawler has to fetch the page to see that directive.

So blocking the page in robots.txt actively prevents its removal: Google cannot fetch the page, cannot see the noindex, and the URL stays in the index indefinitely. The correct sequence is to allow crawling, serve noindex, wait for the pages to drop out, and only then add a Disallow rule if you also want to save crawl budget.

What actually belongs in the file

Most sites need very little. Blocking too much is far more damaging than blocking too little, and a great many self-inflicted traffic losses trace back to an over-broad rule.

  • Worth blocking — internal search result pages, faceted filter URLs that generate near-infinite combinations, cart and checkout paths, admin areas, and staging or print variants of real pages.
  • Never block — CSS and JavaScript files. Google renders pages like a browser, and blocking your assets means it evaluates a broken layout, which harms mobile-friendliness and Core Web Vitals assessment. This was a widespread problem when it was still common advice.
  • Never block — images you want in Google Images, or your own sitemap.
  • Always include — an absolute Sitemap: line pointing at your sitemap URL. It costs nothing and helps discovery.

Directives and how they are actually interpreted

User-agent starts a block of rules for a named crawler; the asterisk matches any crawler that has no block of its own. Note that a crawler obeys only the most specific block that names it — if you write rules for Googlebot and separate rules for the wildcard, Googlebot ignores the wildcard section entirely. Rules are not merged, which surprises people regularly.

Allow creates an exception inside a broader Disallow, which is how you block a directory but permit one file inside it. Where two rules conflict, Google applies the most specific match by path length rather than the order they appear.

Crawl-delay is honoured by Bing and Yandex but ignored completely by Google — control Google's crawl rate through Search Console instead. The obsolete Noindex: and Host: directives are not supported and should not be used.

Before you upload it

Treat robots.txt as a live production file, because it is one of the few files that can remove a whole site from search in a single line. The pattern Disallow: / blocks everything, and it very commonly reaches production because it was correct on the staging server and nobody changed it at launch.

After uploading, fetch the file yourself to confirm it returns a 200 and the expected content, then test specific URLs in Search Console's robots.txt tester. Be aware too that a robots.txt returning a 5xx error is treated by Google as a temporary instruction to stop crawling the site, so an outage on that one file has outsized consequences.

Frequently asked questions

Will Disallow remove a page from Google? #
No, and this is the most common robots.txt mistake. Disallow stops crawling, not indexing — a blocked URL linked from elsewhere can still appear, listed without a description. To remove a page, allow crawling and serve a noindex meta tag or X-Robots-Tag header instead.
Why can Google not see my noindex tag? #
Almost certainly because the page is also blocked in robots.txt. Google must fetch the page to read the noindex, and Disallow prevents that, so the page stays indexed. Remove the Disallow, let the noindex be seen, then re-block later if you want to save crawl budget.
Should I block CSS and JavaScript? #
No. Google renders pages like a browser, so blocking assets means it evaluates a broken layout, which harms mobile-friendliness and performance assessment. Older advice recommended this and it is now clearly wrong.
Where does the file have to go? #
At the domain root, reachable at yourdomain.com/robots.txt. A file anywhere else is ignored. Each subdomain needs its own, and the protocol and port must match — the file for https://example.com does not cover http:// or a different subdomain.
Does Crawl-delay work with Google? #
No. Google ignores it entirely; Bing and Yandex honour it. To influence how fast Google crawls, use the crawl rate setting in Search Console, though it is rarely necessary unless crawling is genuinely straining your server.
Is robots.txt a security measure? #
The opposite. The file is public and readable by anyone, so listing a sensitive path advertises exactly where it is, and malicious crawlers ignore the rules anyway. Protect private areas with authentication, never with a Disallow line.
What if I have no robots.txt at all? #
That is fine — crawlers treat a missing file as permission to crawl everything, which is what most sites want. A 404 for robots.txt is harmless. What you must avoid is the file returning a 5xx error, which Google reads as an instruction to pause crawling the site.