Free Robots.txt Generator

Pick a crawler, decide what it can see, add your sitemap and copy the result. Nothing you type leaves your browser.

Robots.txt Explained: How to Control What Search Engines Crawl

Written by the CrawlKit team. Last updated September 8, 2026.

Most site owners never open their robots.txt file. It is a small text file sitting in your root folder, and it quietly decides which parts of your site Google is allowed to look at. Set it up well and your best pages get picked up faster. Set it up badly and you can hide your whole site from search by accident. That happens more often than you would think. This page explains what the file does, how to write one without breaking things, and the errors people keep making. The tool above will build the file for you.

1. What a robots.txt file actually is

It is a plain text file. Nothing more. You put it in the top folder of your site so it loads at yourdomain.com/robots.txt. Any text editor can make one.

Its job is talking to bots. When Googlebot, Bingbot, or any other crawler shows up at your domain, this file is the first thing it asks for. It reads the rules line by line and decides where to go next. If the file is not there, the bot shrugs and crawls everything, which is fine for plenty of small sites. But here is the part people miss: these are requests, not locks. Google and Bing follow them. Scrapers and spam bots often ignore them completely, so never use robots.txt to protect anything.

2. How crawlers read your rules

Search engines do three separate jobs. They crawl, they index, then they rank. Robots.txt only affects the first one. It has no say in whether a page ranks well.

Picture a bot arriving with a stopwatch running. Your robots.txt is the sign at the door telling it which rooms to skip. Skip the pointless ones and it spends its time on pages you actually want people to find. You are not hiding anything here. You are just directing traffic.

3. Crawl budget, and why it matters

Google will not crawl your site endlessly. Every domain gets a rough allowance for how many pages get fetched and how often. People call it your crawl budget. Google works this way so its servers do not hammer yours.

Small sites hardly ever hit the limit. Bigger ones do, constantly. Run a shop with thousands of filter and sort URLs, or a blog with hundreds of tag pages, and bots can burn the whole allowance on pages nobody searches for. Meanwhile the post you published on Monday still is not indexed by Friday. Blocking the dead weight fixes that.

4. The four lines you need to know

The syntax is short. Four directives cover nearly everything you will ever write. Spelling and slashes matter though, so copy them exactly:

5. Wildcards for finer control

Two symbols let you write smarter rules. The asterisk stands in for any run of characters. Say your internal search results all have a question mark in the URL and you would rather Google skipped them. One line does it: Disallow: /*?*

The dollar sign marks the end of a URL, which is handy for file types. To keep your PDFs out of search, write Disallow: /*.pdf$ and you are done. Google and Bing both understand these. Smaller crawlers sometimes do not, so do not lean on wildcards for anything you really need blocked.

6. The mistakes that cost people traffic

The worst one is a single character. Disallow: / with nothing after the slash blocks your entire site. Every page, gone. It usually happens when someone pushes a staging site live and forgets to change the file. Traffic drops off within a couple of weeks. Read that line twice before you upload.

The second mistake is treating the file as a hiding place. Anyone can read it. Type /robots.txt after any domain and there it is. So listing your admin folder does not hide it, it advertises it. Put private pages behind a password. If you want a page kept out of Google but still reachable by people, use a noindex meta tag instead. Robots.txt and noindex do different jobs, and people mix them up all the time.

7. Using the generator on this page

The tool at the top writes the file for you. Work through it in this order:

  1. Pick a user-agent. Leave it on All Robots unless you need a rule aimed at one search engine.
  2. Choose an action. Allow All opens the whole site. Disallow All shuts it. Custom lets you name specific paths.
  3. List your paths, separated by commas. Things like /wp-admin/, /cart/, /tmp/.
  4. Paste your sitemap link in full, for example https://crawlkit.online/sitemap.xml.
  5. Click Create, then copy the output or download it as robots.txt. Upload that to your root folder, then open Google Search Console and run the robots.txt report. It will flag anything broken before it costs you visitors.

8. Ready-made examples you can copy

Not sure where to start? These three cover most sites. Swap in your own domain and paths.

A normal WordPress site. This is close to what WordPress writes for itself. It keeps bots out of the admin area but leaves open the one file WordPress needs for its own features:

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

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

Blocking internal search and a private folder. Search result pages are the classic crawl-budget drain, and there is rarely a reason for Google to index them:

User-agent: *
Disallow: /search/
Disallow: /*?s=
Disallow: /private/

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

A staging or test site. One rule and nothing gets crawled. Just remember to remove it before the site goes live. Section 6 above explains what happens if you forget:

User-agent: *
Disallow: /

Frequently asked questions

Where do I put the robots.txt file?

In the root folder of your site, so it opens at yourdomain.com/robots.txt. Crawlers only look there. A robots.txt inside a subfolder is ignored.

Will robots.txt remove a page from Google?

Not reliably. It stops Google crawling the page, but if other sites link to it the URL can still show up in results, usually without a description. To keep a page out of search, let Google crawl it and add a noindex meta tag instead.

Do I even need a robots.txt file?

No. Without one, crawlers assume everything is allowed and get on with it. The file earns its place when you have sections that waste crawl budget, such as internal search results, filters or admin areas.

Is anything I type here sent to your server?

No. The generator runs entirely in your browser. Nothing you enter leaves your device.

How do I check the file works?

Open yourdomain.com/robots.txt in a browser to confirm it loads, then use the robots.txt report in Google Search Console. It shows what Google fetched and flags any rules it could not read.

Anything else? Ask us, or read how we handle your data on the privacy policy page.

More guides on crawling and technical SEO

Robots.txt is one piece of a larger picture. These cover the rest, in the same plain English, and they are free to read with no sign-up.

See all 10 guides