Skip to content
HomeToolsRobots.txt

Robots.txt Generator

Build a valid robots.txt file without breaking your crawl budget

robots.txt

User-agent: *
Disallow: /admin/
Disallow: /cart/
Disallow: /checkout/

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

Upload this file to your site's root — it must be reachable at yoursite.com/robots.txt exactly.

A robots.txt file is small, plain text, and easy to get subtly wrong — one misplaced slash and you've accidentally blocked your entire site from Google. Build your rules block by block below and copy or download a clean, correctly formatted file.

What robots.txt actually controls

robots.txt tells well-behaved crawlers which parts of your site they're allowed to request — it's a set of instructions, not a security mechanism. It does not remove pages from search results by itself, and it does not stop crawlers that choose to ignore it, which some do. For pages you genuinely need excluded from search results, a noindex meta tag or HTTP header is the correct tool; robots.txt only manages crawl behavior.

A very common mistake is disallowing a page in robots.txt while expecting that to deindex it — a page blocked from crawling can sometimes still appear in results (typically with no description) if other sites link to it, because Google discovered the URL from those links rather than from crawling the page itself.

Why per-bot rules matter more in 2026

Beyond traditional search crawlers like Googlebot and Bingbot, a growing list of AI-related crawlers (GPTBot, CCBot, and others) now request permission through the same robots.txt mechanism, each identified by its own user-agent string. Many site owners now write separate rule blocks so they can, for example, allow search engine crawling while restricting AI-training crawlers, or vice versa — a distinction that didn't exist a few years ago.

Any user-agent not explicitly matched by a rule block falls back to the wildcard User-agent: * block, so that block should reflect your general policy, with specific bots overridden individually where you want different treatment.

Common robots.txt mistakes worth checking

Blocking /wp-admin/ but forgetting the trailing slash, which can unintentionally also block a page literally named /wp-admin (rare, but it happens). Disallowing a broad path like / by accident during a staging-to-production migration and forgetting to revert it — this alone has taken entire sites out of search results before. Listing a sitemap URL that's outdated or returns a 404, which doesn't break crawling but wastes the file's one genuinely useful signal to bots.

Frequently asked questions

Does robots.txt stop a page from appearing in Google?

Not reliably by itself. It stops crawling of that URL, but the URL can still be indexed with no snippet if other sites link to it. To reliably keep a page out of search results, use a noindex directive instead of, or alongside, a robots.txt disallow rule.

Where does the robots.txt file need to live?

At the root of your domain — exactly at yoursite.com/robots.txt. A file placed in a subfolder or on a different subdomain won't be recognized as governing that domain's crawling.

Is a robots.txt file required?

No — if you don't have one, crawlers generally assume they can crawl everything. Adding one becomes useful once you have admin areas, duplicate parameter URLs, staging paths, or specific bots you want to manage differently.

What happens if I block Googlebot entirely by accident?

Google will stop crawling new content and, over time, may drop already-indexed pages from search results since it can no longer verify they still exist or reflect current content. Always double-check a robots.txt change on a staging environment before deploying it to production.

Should I block AI crawlers like GPTBot?

That's a business decision, not a technical requirement — some site owners want their content excluded from AI training data and block these agents; others are fine with it or want the visibility. There's no universally correct answer, only a preference to declare explicitly.

Working on link building next?

Once your content and technical SEO are in shape, browse vetted guest post and niche edit publishers to build authority.

Browse the gig marketplace