Skip to content
Koit Academy

Robots.txt generator

Your details

One user-agent name per line. Only crawlers that obey robots.txt will stay out.

The details filled in are an example. Everything runs in this browser; nothing you type is sent anywhere or stored.

robots.txt

5 rules for 1 group. Save it as robots.txt at the root of the domain.

User-agent: *
Disallow: /wp-admin/
Disallow: /cart/
Disallow: /checkout/
Disallow: /?s=
Allow: /wp-admin/admin-ajax.php

Sitemap: https://www.example.com/sitemap.xml
  • Note: robots.txt controls crawling, not indexing. To keep a page out of search results, use a noindex tag on the page and leave it crawlable so the tag can be seen.

How to use it · free, no signup

How to use the Robots.txt Generator

List the paths to block, any exceptions and the sitemap address to get a robots.txt with only the fields Google reads, checked for common mistakes. Runs in your browser.

  1. 01

    Choose the starting point

    Open to crawlers with exceptions, or closed while a site is being built.

  2. 02

    List the paths

    Folders and pages to block, and any exceptions inside them to allow.

  3. 03

    Download robots.txt

    Upload it to the root of the domain, so it opens at /robots.txt.

What robots.txt is for

A robots.txt file tells crawlers which addresses on a site they may request. Google’s introduction to robots.txt describes its main use as avoiding overloading a site with requests, and is plain about what it is not: a way of keeping a page out of Google. A blocked address can still be listed, without a description, if other pages link to it. Use robots.txt to keep crawlers out of areas with no value in search, such as carts, internal search results and admin screens.

The four lines Google reads

FieldWhat it does
User-agent:Starts a group of rules for one crawler, or * for all of them
Disallow:A path the crawler should not request
Allow:An exception inside a disallowed path
Sitemap:The full address of a sitemap, for any crawler

According to how Google interprets the robots.txt specification, other fields, crawl-delay included, are not supported. Paths are case sensitive, * matches any run of characters and $ marks the end of the address, so Disallow: /*.pdf$ blocks every address ending in .pdf.

Mistakes the generator checks for

  • Paths without a leading slash. Rules match from the start of the path, so admin/ is written as /admin/.
  • Blocking resources. A rule that looks like it covers CSS, JavaScript or image folders gets a warning.
  • A relative sitemap. The Sitemap line needs the full URL.
  • A whole-site block left in place. Disallow: / under * is fine for a site not yet launched and disastrous after launch.

Testing before you upload

A rule that looks right can block more than intended, because the longest matching rule wins and allow beats disallow only on a tie. Paste the file and a few addresses into the robots.txt tester to see which rule decides each one. The Sitemap line should point at a real file; the XML sitemap generator builds one from a list of URLs.

Published by Koit Academy. Who runs it, how it is paid and how its tools are checked.

Questions

What people ask about the Robots.txt Generator

Does robots.txt keep a page out of Google?
No. Google says robots.txt is not a mechanism for keeping a page out of Google: a blocked URL can still appear in results, without a description. Use a noindex tag, or a password, for that.
Where does robots.txt go?
At the root of the host, so it opens at https://www.example.com/robots.txt. A file in a subfolder is not read, and each subdomain needs its own.
Why is there no Crawl-delay line?
Google does not support crawl-delay; it reads only user-agent, allow, disallow and sitemap. A line Google ignores looks like a setting that works, so the generator leaves it out.
Can robots.txt block AI crawlers?
It can ask them to stay out. Crawlers that follow robots.txt will obey a Disallow: / under their user-agent name; crawlers that do not follow it will not.
Should I block my CSS and JavaScript files?
Usually not. Search engines render pages to understand them, and blocking the files a page needs can make it look broken to the crawler.