Robots.txt File Generator
Generate a professional SEO robots.txt file for your website easily.
Generated Robots.txt
Free Robots.txt File Generator
Our free Robots.txt File Generator creates a clean, valid robots.txt file for your website in seconds. Add your sitemap URL, list the paths you want to block, and generate a ready-to-use file you can copy or download. No syntax knowledge needed, no signup, and zero risk of the typos that quietly de-index a site when the file is written by hand.
A robots.txt file controls how search engines crawl your site. Get one character wrong and you can block your entire website from Google without any warning. This generator removes that risk by building the file from your inputs instead of free text.
What Is a Robots.txt File?
A robots.txt file is a plain text file at the root of your domain that tells search engine crawlers which URLs they are allowed to request. It lives at yoursite.com/robots.txt and is the first file most bots check before crawling. It controls crawling, not indexing, so a blocked page can still appear in search results if other sites link to it.
The file follows the Robots Exclusion Standard, a protocol every major search engine respects. Googlebot, Bingbot, and other well-behaved crawlers read it before requesting anything else on your site. Scrapers and malware bots often ignore it entirely, which is why robots.txt is never a security tool.
According to Google, a page disallowed in robots.txt can still be indexed if it is linked from other sites, usually showing up with no description. If your goal is keeping a page out of search results, a noindex tag or password protection is the correct method, not a Disallow rule.
How to Use This Robots.txt Generator
To create a robots.txt file, enter your sitemap URL, add any paths you want to block one per line, then click Generate. The tool builds a correctly formatted file you can copy or download. Upload it to your website root so it is reachable at yoursite.com/robots.txt, then test it in Google Search Console.
- Enter your sitemap URL. This points crawlers straight to your most important pages, for example https://yoursite.com/sitemap_index.xml.
- Add paths to disallow. List one path per line, such as /wp-admin/ or /cart/. Leave this blank to allow full crawling.
- Click Generate. The tool produces a clean, valid robots.txt with correct syntax and spacing.
- Copy or download the file. Save it as robots.txt with UTF-8 encoding.
- Upload it to your site root and confirm it loads at yoursite.com/robots.txt, then test key URLs in Search Console.
Robots.txt Syntax: The Directives Explained
A robots.txt file is built from four core directives. User-agent targets a specific crawler, Disallow blocks a path, Allow permits a path inside a blocked folder, and Sitemap points to your XML sitemap. Each rule goes on its own line, paths are case sensitive, and crawlers apply the most specific matching rule rather than the first one listed.
Directive | What It Does | Example |
User-agent | Names the crawler a rule block applies to | User-agent: * |
Disallow | Blocks a path from being crawled | Disallow: /wp-admin/ |
Allow | Permits a path inside a blocked folder | Allow: /wp-admin/admin-ajax.php |
Sitemap | Tells crawlers where your sitemap lives | Sitemap: https://site.com/sitemap.xml |
Crawl-delay | Asks bots to wait between requests (ignored by Google) | Crawl-delay: 10 |
The asterisk in User-agent: * is a wildcard meaning all crawlers. To target one bot, name it directly, like User-agent: Googlebot. A blank Disallow value allows everything, while Disallow: / blocks the entire site.
What to Allow and What to Disallow
Block paths with no search value that waste crawl budget, such as admin pages, cart and checkout URLs, internal search results, and duplicate filter URLs. Never block CSS, JavaScript, or image folders that search engines need to render your pages, since a page that cannot render properly can be misjudged on quality during indexing.
Common paths worth blocking on most sites include:
- /wp-admin/ while allowing /wp-admin/admin-ajax.php
- Internal search result pages like /?s=
- Cart, checkout, and account URLs on ecommerce stores
- Staging or development folders
- Thank-you and confirmation pages with no search intent
Search engines run on a crawl budget, the number of pages a bot will crawl in a given window. Blocking low-value sections helps crawlers spend that budget on the pages that actually drive traffic. This matters more as a site grows, since 91% of pages get zero organic traffic from Google according to Ahrefs, and crawl waste only widens that gap.
Controlling AI Crawlers in 2026
A modern robots.txt file is no longer just about Googlebot and Bingbot. You can now allow or block AI crawlers like GPTBot, ClaudeBot, Google-Extended, and PerplexityBot, plus SEO crawlers like AhrefsBot and SemrushBot. Each is controlled with its own User-agent block, giving you direct say over which bots can access your content for training or indexing.
If you want to block a specific AI crawler from using your content, add a dedicated block for it:
- User-agent: GPTBot then Disallow: / blocks OpenAI’s crawler
- User-agent: Google-Extended then Disallow: / opts out of Google AI training while keeping normal search crawling
- User-agent: CCBot then Disallow: / blocks the Common Crawl bot used by many AI datasets
Blocking these has no effect on your normal Google or Bing search rankings, since those use separate user agents. This is purely a control over AI and third-party data access.
Robots.txt for WordPress
WordPress generates a virtual robots.txt automatically, but uploading a custom file gives you real control. A safe WordPress setup blocks the admin area and internal search while allowing admin-ajax.php and listing your sitemap. Never block /wp-content/ as a whole, since it holds theme and plugin files that Google needs to render your pages.
A clean starting template for a WordPress site looks like this:
User-agent: *
Disallow: /wp-admin/
Disallow: /?s=
Allow: /wp-admin/admin-ajax.php
Sitemap: https://yoursite.com/sitemap_index.xml
Swap in your own sitemap URL, generate the file above, and upload it to your root directory. If you run an e-commerce store, add cart, checkout, and my-account paths to the Disallow list.
Common Robots.txt Mistakes to Avoid
The most damaging robots.txt mistake is leaving Disallow: / in the live file, which blocks your entire site. Other frequent errors include blocking CSS and JavaScript files, listing sensitive pages that the file then publicly advertises, and assuming robots.txt removes pages from Google’s index when it only controls crawling.
- The accidental full block. A stray Disallow: / tells every crawler to ignore your whole site. This often happens when a staging file is pushed live during a migration.
- Blocking render-critical files. Disallowing theme CSS or JS stops Google from seeing your page as a user does, which can hurt rankings, especially on visual builders like Elementor.
- Using robots.txt for privacy. The file is public, so listing a sensitive path just shows everyone where it is. Use password protection or noindex instead.
- Case sensitivity. Paths are case sensitive, so /Photo/ and /photo/ are treated as different directories.
Using a generator instead of writing the file by hand removes nearly all of these risks, since the syntax is built correctly from your inputs every time.
Robots.txt vs Sitemap vs Noindex
These three serve different jobs. Robots.txt controls which paths crawlers can access, a sitemap lists the URLs you want crawled and indexed, and a noindex tag keeps a crawlable page out of search results. A healthy technical SEO setup uses robots.txt and a sitemap together, and reserves noindex for pages that must stay out of Google.
A common error is contradicting these signals, for example listing a URL in your sitemap while blocking it in robots.txt. If you want a page removed from search, allow crawling and add a noindex tag, since Google cannot read a noindex tag on a page it is not allowed to crawl. For a deeper breakdown, see our guides on the SEO blog.
Why a Proper Robots.txt File Helps Your SEO
A well-configured robots.txt file improves SEO by guiding crawlers toward your valuable pages and away from low-value ones, preserving crawl budget and helping important content get indexed faster. While robots.txt is not a direct ranking factor, crawl efficiency directly affects how quickly and completely your site is processed.
Backlinks remain one of Google’s top three ranking factors, and none of that earned authority matters if crawl issues keep your best pages from being processed correctly. Domain Authority, the 1 to 100 Moz score built largely on backlink signals, grows fastest on sites where crawling and indexing run cleanly. Once your robots.txt is set, check your authority with our free DA PA tool and scan for crawl-wasting dead links using our Bulk Broken Link Checker.
Frequently Asked Questions
Is this robots.txt generator free?
Yes, our Robots.txt File Generator is completely free with no signup or limits. Enter your sitemap and disallow paths, generate the file, and copy or download it instantly. You can come back and regenerate an updated file any time your site structure changes, alongside our full suite of free SEO tools.
Where do I put the robots.txt file after generating it?
Upload it to the root directory of your site so it loads at yoursite.com/robots.txt. It will not work in a subfolder. On WordPress, you can upload it via FTP or paste the contents into your SEO plugin’s robots.txt editor, such as Yoast or Rank Math.
Does robots.txt remove my pages from Google?
No. Robots.txt only controls crawling, not indexing. A blocked page can still appear in search results if other sites link to it, usually with no description. To remove a page from search, use a noindex tag on a crawlable page or password protect it instead.
Can I block AI crawlers like GPTBot with robots.txt?
Yes. Add a dedicated User-agent block for the bot, such as GPTBot, ClaudeBot, or Google-Extended, followed by Disallow: / to block it. This stops the AI crawler from accessing your content without affecting your normal Google or Bing search rankings, since those use separate user agents.
How do I test my robots.txt file after uploading it?
Open Google Search Console and use the URL Inspection tool on a few key pages to confirm they are not unexpectedly blocked. Always test before and after changes, since a single misplaced character can block far more than intended. Pair this with a quick authority check using our bulk domain authority checker.
Generate Your Robots.txt File Now
Scroll back up, enter your sitemap URL and any paths you want to block, and generate a clean, valid robots.txt file in seconds. It is free, requires no signup, and removes the typo risk that comes with writing the file by hand. Once your crawl setup is clean, explore our full suite of SEO tools or get a second opinion from our expert SEO consultant service.