Robots.txt Generator

Build a valid robots.txt file in seconds: set the user-agent, the paths to block or allow and your sitemap URL, then copy or download the file.

A robots.txt file is a short text file at the root of your website that tells search engine crawlers which parts of the site they shouldn't crawl. It's one of the first files Googlebot requests, and a single wrong line can hide your whole site. This generator builds the file from a few simple fields, so the syntax is always correct.

How to create your file

  1. User-Agent: leave it as * to give the rules to every crawler, or enter a specific bot such as Googlebot or Bingbot.
  2. Disallow paths: one path per line for areas crawlers shouldn't visit, for example /admin/ or /cart/.
  3. Allow paths: exceptions inside a blocked folder, for example /admin/admin-ajax.php.
  4. Crawl-delay: optional, in seconds (see the note below).
  5. Sitemap URL: the full address of your XML sitemap.
  6. Click Generate robots.txt, then Copy or Download.

Upload the file to the top level of your domain so it opens at https://yourdomain.com/robots.txt. Crawlers don't look for it anywhere else, and each subdomain needs its own file.

Example: a typical online shop

User-agent: *
Disallow: /cart/
Disallow: /checkout/
Disallow: /account/
Disallow: /search
Allow: /search/help

Sitemap: https://example.com/sitemap.xml

Cart, checkout and account pages are different for every visitor and have no value in search results, and internal search pages can create endless URL combinations that waste crawl time. Everything else, including product and category pages, stays open.

Five mistakes worth avoiding

  1. Disallow: / blocks everything. It's common on staging sites and is sometimes copied to the live site by accident. If your pages suddenly disappear from Google, check this first.
  2. robots.txt doesn't remove pages from Google. A blocked page can still be indexed if other sites link to it, just without a description. To keep a page out of results, let it be crawled and add a noindex meta tag instead.
  3. Don't block CSS and JavaScript. Google renders pages like a browser. If it can't load your stylesheets and scripts, it may judge the page as broken or not mobile-friendly.
  4. Paths are case-sensitive. /Admin/ and /admin/ are different rules.
  5. It isn't a security measure. The file is public, and badly behaved bots ignore it. Protect private areas with a login, not with robots.txt.

A note on Crawl-delay

Bing and some other crawlers respect Crawl-delay, but Googlebot ignores it. Google adjusts its crawl rate automatically based on how quickly your server responds. Only add a delay if a specific bot is overloading your server.

Check it after uploading

Open your robots.txt in a browser to confirm it's live, then use the robots.txt report in Google Search Console (Settings ? robots.txt) to see the version Google fetched and any errors it found. Test an important page with the URL Inspection tool to confirm it isn't blocked.

Running WordPress? The WordPress robots.txt Generator starts from WordPress-specific rules. Make sure the sitemap you reference is valid with the XML Sitemap Generator, and read How to Create the Perfect Robots.txt File for SEO for more examples.

Frequently Asked Questions

In the root folder of your domain, so it opens at https://yourdomain.com/robots.txt. Crawlers only check that exact location, and each subdomain needs its own file.

Not reliably. It stops crawling, but a blocked page can still be indexed if other pages link to it. Use a noindex meta tag on a crawlable page to keep it out of search results.

No. Googlebot ignores Crawl-delay and sets its own crawl rate based on your server's response. Bing and some other crawlers do respect it.

No. Google needs them to render your pages properly. Blocking them can make Google think your pages are broken or not mobile-friendly.

It isn't required. Without one, crawlers simply crawl everything they can find. It's still worth having one to point to your sitemap and to keep crawlers out of pages like carts, logins and internal search results.