Robots.txt generator rules for crawlers

Make a robots.txt for your site in your browser, with nothing uploaded: allow search engines, keep folders out, block AI training crawlers and point to your sitemap.

  • Nothing uploaded
  • AI crawlers option
  • robots.txt to download
  • Free, no sign-up

Robots.txt Generator

Fill in the boxes to see the result.

Getting ready…

Quick facts from our tests

Check it yourself: once the page has loaded, turn off Wi-Fi and mobile data, and Robots.txt Generator still works. Your browser's network panel (F12 on a computer) lists every request the page makes: you'll see Google's ad requests, and none of them carries what you type. Our code never gives what you type to the ad code. How we prove it

How to make a robots.txt file

  1. Choose the rules

    Allow, block, folders.

  2. Block AI crawlers

    If you like.

  3. Download robots.txt

    Put it at your site's top.

When this tool isn't the right fit

  • You want to hide private pages. Robots.txt is a polite request that anyone can read. Put private pages behind a login.
  • You want a page removed from search results. Robots.txt doesn't do that. Give the page a noindex tag with Meta Tag Generator.
  • You need rules for one particular crawler. The page writes rules for all crawlers plus the AI crawlers' block; add other groups by hand.

Why use PDFGuild's robots.txt generator

More free tools

Private like this one: nothing you type or add leaves your device.

Robots.txt Generator: the complete guide

What robots.txt does and doesn't do, the rules line by line, blocking folders and AI crawlers, sitemaps, where the file goes, and testing it.

In this guide
  1. What it does
  2. How it works
  3. Real results
  4. Step by step
  5. The file line by line
  6. What to block, and what not to
  7. Paths match from the start
  8. Not a lock, and not noindex
  9. AI crawlers
  10. Should you block AI training?
  11. Common kinds of site
  12. One page inside a blocked folder
  13. Wildcards
  14. Scrapers and bad bots
  15. After a redesign
  16. The sitemap line
  17. Where the file goes
  18. A missing or broken file
  19. WordPress, Blogger and Shopify
  20. Test and staging sites
  21. Testing it
  22. A worked example
  23. Privacy
  24. Problems and fixes
  25. Limits
  26. Other ways
  27. Terms explained

What Robots.txt Generator does, and when you need it

Robots.txt Generator writes a robots.txt file: the small text file at the top of a website that tells search engines and other crawlers which parts they may visit. Choose whether to allow the whole site, list the folders or pages to keep crawlers out of, add your sitemap's address, and tick a box to ask AI training crawlers to stay away. The file is made in your browser, with nothing uploaded and no sign-up, ready to download as robots.txt.

People use it when:

  • A new site needs its first robots.txt, with the sitemap named, so search engines find every page.
  • Admin pages, carts or internal search results are wasting search engines' time.
  • A site owner wants AI companies' crawlers to stop collecting the site for training.
  • A test copy of a site must stay out of search engines while it is being built.

How it works

The page writes the rules in the standard format, the Robots Exclusion Protocol, which the IETF published as RFC 9309 in 2022:

  • One group for every crawler, starting User-agent: *, with Allow: / for the whole site, Disallow: / to block it all, or a Disallow line for each folder or page you list.
  • A group for each AI crawler, when that box is ticked, each with Disallow: /.
  • A Sitemap line at the end, when you give its address.

It checks that every listed path starts with a slash and that the sitemap address is a full https:// address, and says so in words when one doesn't.

Real results from our tests

On 31 October 2026 we made a robots.txt with the page's own code for a made-up shop, blocking /admin/, /cart/ and /search, with AI crawlers blocked and a sitemap, then asked Python's urllib.robotparser, a separate reader that shares no code with the page, what each crawler may fetch.

Crawler and addressAllowed?Why
Googlebot, the home pageYesNothing blocks it
Googlebot, /products/sareeYesNot under a blocked path
Googlebot, /admin/usersNoUnder /admin/
Googlebot, /search?q=sareeNoStarts with /search
Googlebot, /searching-tipsNoAlso starts with /search: see below
GPTBot, the home pageNoAI crawlers blocked
ClaudeBot, /products/sareeNoAI crawlers blocked everywhere

What the numbers mean: in all 7 checks the file did exactly what it said, sitemap included, and the one surprise is a real lesson. Rules match addresses from their start, so Disallow: /search also blocks /searching-tips. Paths match from the start shows how to block only what you mean.

On a first visit the page downloads about 0.1 MB for the tool: the page, its styles, its scripts and the fonts, with Google's ad code not counted.

Step by step

  1. Choose For all search engines: Allow the whole site, or Block the whole site.
  2. List the folders or pages to block, one on each line, each starting with /, such as /admin/.
  3. Add your sitemap's full address, such as https://example.com/sitemap.xml.
  4. Tick Block AI training crawlers if you want them to stay away.
  5. Download robots.txt, or copy it, and put it at the top of your site.
The Robots.txt Generator after its example: a robots.txt that blocks three folders and names the sitemap, ready to copy or download
Our example robots.txt, written in the browser.

The file, line by line

LineMeans
User-agent: *The rules below are for every crawler
User-agent: GPTBotThe rules below are for that crawler only
Allow: /The whole site may be crawled
Disallow: /admin/Nothing whose address starts with /admin/
Disallow: /Nothing at all
Sitemap: https://…Where the list of the site's pages is

A crawler follows the group that names it most exactly, and only that group: GPTBot follows its own Disallow: / and ignores the rules for everyone. Lines that start with # are notes for people; crawlers skip them.

What to block, and what not to

Worth blocking: admin and login pages, carts and checkouts, internal search results, and endless filtered or sorted copies of the same list, which waste search engines' visits on pages nobody should land on.

Not worth blocking: your CSS, JavaScript and images. Google draws pages as a visitor sees them, and a page whose styles are blocked can look broken to it. And never block a page you want out of search results: see below.

Paths match from the start

A Disallow path blocks every address that begins with it. That is why our test's Disallow: /search also blocked /searching-tips. Three ways to be exact:

  • End folders with a slash: /admin/ blocks the folder, while /admin would also block /administration-fees.
  • Block search results by their question mark: /search? blocks /search?q=saree but not /searching-tips.
  • Use $ for an exact end, which Google and Bing understand: /search$ blocks /search alone.

Paths are case-sensitive: /Admin/ and /admin/ are different.

Not a lock, and not noindex

Robots.txt is a polite request. Well-behaved crawlers follow it; others don't, and anyone can read the file and visit what it lists, so never use it to hide private pages: put those behind a login.

It also doesn't remove pages from search results. A blocked page can still be listed if other sites link to it, with no description, because Google can't read it. To keep a page out of results, let it be crawled and give it a noindex tag, which Meta Tag Generator writes. Google stopped reading noindex lines inside robots.txt in 2019.

AI crawlers

Ticking Block AI training crawlers adds a group with Disallow: / for each crawler that collects pages to train AI models: GPTBot (OpenAI), Google-Extended (Google's control for its AI models), CCBot (Common Crawl, whose collection many AI models learn from), ClaudeBot and anthropic-ai (Anthropic), Bytespider (ByteDance), Applebot-Extended (Apple's control for AI training) and meta-externalagent (Meta).

It leaves alone the bots that fetch pages for AI answers and AI search, which show your page and link to it: ChatGPT-User and OAI-SearchBot (OpenAI) and PerplexityBot (Perplexity). Blocking those would take your site out of the answers people read there, which is a different choice from keeping your words out of training. If you want that too, add a group for each by hand, the same way: User-agent: PerplexityBot, then Disallow: /.

  • Google Search isn't affected: Google-Extended controls AI use only, so blocking it doesn't change how Googlebot ranks you.
  • It works going forward: what was collected before stays collected.
  • New crawlers appear all the time; check the list again now and then.
  • It is still a request: crawlers that ignore robots.txt aren't stopped by it.

Should you block AI training?

There is no right answer for every site, only a trade. Blocking training crawlers keeps your words out of future training collections, which matters to writers, newspapers, course makers and anyone whose text is what they sell. Allowing them lets models learn what your business is and does, which some small businesses want, so that assistants describe them correctly. Either way, Google Search and the AI answers that cite and link to pages are separate, as above. Decide once, write it down with the date, and look at the list again every few months.

Robots.txt for common kinds of site

SiteUsually block
A blog or a small business siteNothing: allow the whole site and give the sitemap
An online shop/cart/, /checkout/, /account/, search results (/search?), and sorted or filtered copies of lists
WordPress/wp-admin/, with admin-ajax.php allowed (see below)
A members' or school portalThe login area; its pages need passwords anyway
A test or staging copyEverything: Block the whole site, and a password
A site that sells its writing, such as news or coursesOften the AI training crawlers too: tick the box

When unsure, block less. A missing robots.txt, or one that allows everything, is safe for most small sites; a wrong Disallow can quietly hide pages you want found.

Allowing one page inside a blocked folder

Sometimes a folder should be blocked except for one file. WordPress is the usual case: block /wp-admin/, but allow /wp-admin/admin-ajax.php, which some themes need for pages to work. Write the Allow line under the same User-agent group:

Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

Google follows the rule with the longest matching path, so the longer Allow wins for that one file. The page writes the Disallow lines for your list; add such an Allow line by hand after downloading, in any text editor.

Wildcards: * and $

Google and Bing understand two special characters in paths:

  • * stands for anything: /*?sort= blocks every address with ?sort= in it, wherever it is on the site.
  • $ marks the end: /*.pdf$ blocks addresses that end in .pdf, and nothing else.

Other crawlers may not understand them, and a careless * can block far more than intended, so check a few addresses it should and shouldn't block with URL Inspection in Search Console before relying on it.

Scrapers and bad bots

Robots.txt only works with crawlers that choose to obey it. Spam bots, content scrapers and attackers ignore it, and some read it to find what you would rather hide. To slow or stop them, use your host's or your CDN's tools: rate limits, bot protection or blocking by address. Robots.txt is for managing honest crawlers, such as search engines, and nothing more.

After a redesign or a move

A site that changes its addresses can end up with old rules that block new pages, or with the staging site's Disallow: / copied to the live one. After any redesign, a move to a new host or a new domain, open the live robots.txt, check every Disallow against the new addresses, and look at Search Console's Pages report over the following weeks for pages "blocked by robots.txt" that should be open.

Moving to a new domain? Leave the old domain's robots.txt open. Search engines must read the old addresses to see where each one now redirects; blocking them hides the redirects and slows the whole move.

The sitemap line

A sitemap lists the pages you want found, and naming it in robots.txt lets every search engine that reads the file find it, not only the ones you have told directly. Give its full address, starting https://. Most site builders and SEO plugins make the sitemap themselves, often at /sitemap.xml or /sitemap_index.xml; open it in a browser to check the address before adding it.

Where the file goes

Robots.txt must sit at the top of the site, so it opens at https://yoursite.com/robots.txt, and be called exactly robots.txt, in small letters. A file in a folder is never read. Each address needs its own: shop.example.com and example.com read separate files, and so do http and https versions if both are served. Google reads up to 500 KB of it, far more than any normal file needs, and keeps its copy for up to a day, so changes take effect within about 24 hours.

A missing or broken file

No robots.txt at all, a page that answers "not found", means crawlers may read the whole site, which is fine for most small sites. A server error when Google asks for the file is different: Google holds back from crawling the site until it can read the file again, so a host that keeps failing on robots.txt can slow the crawling of every page. If Search Console's robots.txt report shows fetch errors, ask your host to fix them before anything else.

On WordPress, Blogger and Shopify

  • WordPress makes a robots.txt itself; SEO plugins such as Yoast SEO and Rank Math have an editor for it. Uploading your own file to the site's top folder replaces it.
  • Blogger: Settings, then Crawlers and indexing, where Enable custom robots.txt lets you paste the file's text.
  • Shopify makes one too, and its theme code can edit it; Shopify's own rules are sensible for most shops.
  • Other hosts: upload robots.txt to the folder that holds your home page.

Test and staging sites

Choose Block the whole site for a test copy, such as staging.example.com, so search engines don't list a half-built site, still full of placeholder text from Lorem Ipsum Generator. Two cautions: a password on the test copy keeps people and crawlers out far more surely, and the block must never be copied to the real site when it goes live, a mistake that takes whole sites out of Google. Check the live site's robots.txt on launch day.

Testing it

  1. Open https://yoursite.com/robots.txt in a browser: you should see your file, as plain text.
  2. In Google Search Console, Settings has a robots.txt report showing the file Google last fetched and any problems it found.
  3. URL Inspection in Search Console says whether a given page is blocked by robots.txt.
  4. Bing Webmaster Tools has a robots.txt tester of its own, for Bing's crawler.

A worked example: a small online shop

A saree shop's site has an admin area at /admin/, a cart at /cart/ and search results at /search?q=…, and a blog page called /searching-for-the-right-silk. The owner lists /admin/, /cart/ and /search? (with the question mark, so the blog page stays open), adds https://shop.example.com/sitemap.xml, and ticks Block AI training crawlers. The file is eleven short groups: one for every crawler and one for each of the ten AI crawlers. Uploaded to the site's top folder, it opens at /robots.txt, and Search Console's robots.txt report shows it fetched without errors the next day.

Private: made on your device

The file is written inside your browser; nothing you type is sent to us or kept, and once loaded the page works with the internet switched off. Google's ad code runs on the page too, but our code never gives it what you type. How we prove it shows how anyone can check.

The Robots.txt Generator after its example: a robots.txt that blocks three folders and names the sitemap, ready to copy or download, at a phone's size with the internet switched off by our test, between our test's bands that read "Internet switched off" and "Nothing uploaded: 0 requests sent data"
Proof from our testOn 9 November 2026, our test opened Robots.txt Generator at a phone's size, switched the internet off and ran it on its built-in example. It finished with no connection, and none of the page's 16 requests sent any data.How we test, and how to check it yourself

Problems and fixes

"Each line starts with /, like /admin/ (admin/)."
A path is missing its first slash. Paths start at the site's top: /admin/, not admin/ or https://example.com/admin/.
"Type the full address, like https://example.com/sitemap.xml."
The sitemap address lacks https:// or has a space.
A page I blocked still shows in Google
Blocking stops crawling, not listing. Unblock it and add a noindex tag instead.
Google says pages are blocked that shouldn't be
A short path matched more than you meant, as /search matched /searching-tips. End folders with a slash, or use ? or $.
The whole site vanished from Google
Disallow: / reached the live site. Change it to Allow: / at once and check Search Console.

Limits

  • Rules for every crawler, plus the AI crawlers' block; no groups of your own for other crawlers.
  • Disallow lines only for your list; Allow exceptions inside blocked folders are written by hand.
  • No crawl-delay line: Google ignores it, and other crawlers treat it differently.
  • It writes the file; it doesn't upload it or read your site.

Other ways

WordPress's SEO plugins, Blogger's settings and Shopify's theme editor all let you change robots.txt inside the site. A text editor works too: it is a plain text file. This page writes a correct one in seconds, with the AI crawlers' names spelled right, and explains each line.

Terms explained

Crawler
A program that visits web pages to read them, such as Googlebot.
User-agent
The name a crawler goes by, used in robots.txt to give it rules.
Disallow and Allow
The lines that close or open paths to a crawler.
Path
The part of an address after the site's name, starting with /.
Sitemap
A file listing the pages a site wants found.
Noindex
A tag on a page asking search engines not to list it.
Training crawler
A crawler that collects pages to teach AI models, such as GPTBot or CCBot.
AI search bot
A bot that fetches a page to answer a question and link to it, such as OAI-SearchBot or PerplexityBot.

Frequently asked questions

Is this robots.txt generator free?

Yes, with no sign-up and no limit. Ads from Google help pay for the site, and our code never gives them what you type.

What is robots.txt?

A small text file at the top of a site that tells crawlers, such as Googlebot, which parts they may visit.

Where does the file go?

At the top of the site, so it opens at https://yoursite.com/robots.txt, named exactly robots.txt. Each subdomain needs its own.

Does robots.txt hide pages?

No. It is a polite request that anyone can read; private pages need a login.

Does blocking a page remove it from Google?

No. A blocked page can still be listed from links. To keep a page out of results, allow crawling and add a noindex tag.

Why did /search also block /searching-tips?

Paths match from their start. Block /search? for search results, end folders with a slash, or use $ for an exact match.

Should I block CSS and JavaScript?

No. Google draws pages as visitors see them, and blocked styles can make a page look broken to it.

Which AI crawlers does the box block?

The ones that collect pages to train AI models: GPTBot, Google-Extended, CCBot, ClaudeBot, anthropic-ai, Bytespider, Applebot-Extended and meta-externalagent. Bots that fetch pages for AI answers and search, such as ChatGPT-User and PerplexityBot, stay allowed, so those answers can still show and link to your site.

Will blocking AI crawlers hurt my Google ranking?

No. Google-Extended controls Google's AI use only; Googlebot and Search are not affected.

Do I need a Sitemap line?

It helps every search engine find your sitemap. Give its full address, starting https://.

How fast do changes work?

Google keeps its copy of the file for up to a day, so changes take effect within about 24 hours.

How do I block a test site?

Choose Block the whole site, and put a password on it too. Never copy that file to the live site.

How do I test the file?

Open yoursite.com/robots.txt, then check Search Console's robots.txt report and URL Inspection.

Can I set a crawl delay?

Not here: Google ignores crawl-delay, and other crawlers treat it differently.

Is what I type sent anywhere?

No. The file is written in your browser; what you type is never sent or kept. How we prove it shows how to check.

By the PDFGuild team · Updated · How we test