Robots.txt Generator

SEO Tools

Build a valid robots.txt with the crawl rules you want.

  • 100% FreeNo hidden charges
  • Stays on Your DeviceNothing is uploaded
  • Easy to UseSimple and quick
  • Any DeviceBrowser, mobile and tablet

Upload robots.txt to the root of your site so it is reachable at yoursite.com/robots.txt.

The HN Solutions Robots.txt Generator builds a correct, valid robots.txt file in seconds. Start from a ready-made preset — allow everything, a WordPress-optimised setup, block AI training bots like GPTBot, or block all crawlers — then add your own disallowed paths and your sitemap URL, and copy or download the finished file.

Why our robots.txt generator is better

  • One-click presets — including a WordPress preset and an up-to-date “block AI bots” list (GPTBot, ClaudeBot, CCBot, Bytespider and more).
  • Correct syntax guaranteed — no typos or invalid directives that could accidentally block your whole site.
  • Sitemap line included — so search engines find every page faster.
  • Copy or download a ready-to-upload robots.txt file.
  • Free and instant, generated fully in your browser.

How to create a robots.txt file

  1. Pick a preset that matches your site.
  2. Add your sitemap URL and any extra paths to block.
  3. Copy or download the file and upload it to your site’s root folder.

Frequently asked questions

What is a robots.txt file?

Robots.txt is a plain text file at the root of your website that tells search engine crawlers which parts of the site they may or may not crawl.

Where do I put robots.txt?

In the root directory of your domain, so it loads at yoursite.com/robots.txt. On WordPress, many SEO plugins like Rank Math can save it for you.

Can robots.txt block AI bots from using my content?

Yes. The “Block AI bots” preset adds rules for crawlers like GPTBot, ClaudeBot, Google-Extended and CCBot that collect content for AI training.

Does robots.txt remove pages from Google?

Not by itself. It stops crawling, but to keep a page out of search results you should use a noindex meta tag instead.

Is this robots.txt generator free?

Yes, completely free with no sign-up and no limits.

See all our free utilities in the SEO tools hub and daily tools hub.

The mistakes that deindex a site

Disallow: / under User-agent: * blocks your entire site. It is the correct setting on a staging server and catastrophic in production — and it reaches production regularly, because staging files get copied across during a launch. Check yours after any migration or redesign.

Blocking CSS and JavaScript. Google renders pages before judging them. If your theme assets are blocked, it sees a broken layout and rates the page accordingly.

Assuming Disallow means private. It asks crawlers not to fetch a URL. It does not hide it, and a disallowed page can still appear in results if other sites link to it. To keep a page out of the index, use a noindex meta tag — and note that the page must be crawlable for Google to see that tag at all.

Blocking AI training crawlers

Robots.txt has become the standard place to state whether AI companies may use your content for training. The major crawlers respect it by convention rather than obligation:

  • GPTBot — OpenAI training
  • ClaudeBot — Anthropic
  • Google-Extended — Gemini training, separate from Googlebot
  • CCBot — Common Crawl, which feeds many datasets

Blocking Google-Extended does not affect normal Search ranking. Blocking Googlebot very much does — do not confuse them.

Where the file must live

The domain root, and nowhere else: yoursite.com/robots.txt. A file in a subfolder is ignored entirely. Subdomains need their own — blog.yoursite.com does not inherit from the main domain.

WordPress serves a virtual robots.txt by default. If you upload a physical file it takes over; if you use Rank Math or Yoast, edit through the plugin so you are not maintaining two versions that disagree.

Keep it short

Every rule is a chance to be wrong. A long robots.txt accumulated over years usually contains lines nobody can explain and at least one that blocks something it should not. Most sites need a handful of rules and a sitemap line.

After changing it, verify at yoursite.com/robots.txt and check Search Console’s robots report, which shows the file Google actually fetched and any parse errors. Pair it with the XML sitemap generator to point crawlers at what you do want indexed.

Now test what you built

Paste the file into the Robots.txt Tester to confirm each rule behaves the way you expect.

Robots.txt: Block AI Bots, Avoid the Killer Slash

There is a plain text file at the root of your website that every search engine reads before it looks at anything else. Written correctly, it keeps crawlers focused on the pages that matter. Written wrongly — sometimes by a single character — it can wipe your entire site from Google. In 2023, a misplaced Disallow: / pushed a well-known brand’s whole domain out of search for days; it happens to someone every week.

And robots.txt has taken on a second life: it is now the standard place to tell AI companies whether they may harvest your content for model training. This guide explains how the file works line by line, the classic mistakes, the AI-bot question, the best generators, and the correct setup for WordPress and most sites.

What robots.txt actually does

Robots.txt implements the Robots Exclusion Protocol — a set of polite instructions to crawlers, served at yoursite.com/robots.txt. Its directives:

  • User-agent: which bot the following rules address (* = everyone, Googlebot, GPTBot…).
  • Disallow: paths that bot should not crawl. Disallow: /admin/ blocks a folder; Disallow: / blocks everything; Disallow: (empty) blocks nothing.
  • Allow: carve-outs inside blocked areas — the classic WordPress example allows admin-ajax.php inside blocked /wp-admin/.
  • Sitemap: the full URL of your XML sitemap, so every crawler finds your page list immediately.
  • Crawl-delay: seconds between requests — respected by some bots (not Google), occasionally useful on struggling servers.

The critical nuance: robots.txt controls crawling, not indexing. A blocked page can still appear in results (as a bare URL) if other sites link to it. To keep a page out of Google, use a noindex meta tag — set it in seconds with our meta tag generator — and do not block the page in robots.txt, or Google can never see the noindex. Getting this backwards is the most common advanced mistake in SEO.

One typo can deindex a site — the most expensive slash in SEO

The mistakes that cost real traffic

The HN Solutions robots.txt generator producing a WordPress preset with sitemap line and crawl rules ready to copy
The WordPress preset in our robots.txt generator, with the sitemap line filled in. Screenshot taken on HN Solutions.
  • The killer slash: Disallow: / under User-agent: * — often a staging-site setting that ships to production. Check yours today.
  • Blocking CSS and JS: Google renders pages; block your theme assets and it sees broken layouts, and rankings follow.
  • Blocking instead of noindexing (see above) — the page stays in results, ugly and uncontrolled.
  • Case and path errors: rules are case-sensitive; /Admin/ does not block /admin/.
  • No sitemap line: free discovery, skipped.
  • Cargo-cult copying: pasting another site’s file, inheriting rules that make no sense for yours.

The AI bot question

AI companies crawl the web for training data, and most now respect robots.txt opt-outs. The main user-agents: GPTBot and ChatGPT-User (OpenAI), ClaudeBot and anthropic-ai (Anthropic), Google-Extended (Gemini training — separate from Googlebot, so blocking it does not affect search), CCBot (Common Crawl, feeding many models), PerplexityBot, Bytespider (ByteDance), Amazonbot, Applebot-Extended and meta-externalagent.

Should you block them? Trade-offs, honestly: blocking asserts control over your content and keeps it out of training sets; allowing may earn citations in AI answers, which is becoming a real traffic source. Publishers increasingly block training bots (GPTBot, Google-Extended, CCBot) while leaving search-adjacent bots alone. Whatever you choose, our generator’s “Block AI bots” preset writes the current list correctly in one click.

How to set up robots.txt correctly

  1. Open the robots.txt generator.
  2. Pick your preset — WordPress for most blogs, Allow everything for simple sites, Block AI bots if that is your policy.
  3. Add extra paths to block: cart and checkout pages, internal search results, staging folders.
  4. Paste your sitemap URL (make one with the XML sitemap generator if needed).
  5. Download and upload to your site root — or paste into Rank Math → General Settings → Edit robots.txt on WordPress.
  6. Verify at yoursite.com/robots.txt, then check Search Console’s robots report for errors.

Pro tips: never block /wp-content/ wholesale — your images and CSS live there; keep the file lean — every rule is a chance to be wrong; and audit it whenever you migrate hosts or launch a redesign, which is exactly when killer slashes sneak in.

Robots.txt questions we get asked

Do all bots obey robots.txt?

Reputable ones do — Google, Bing, the major AI crawlers. Scrapers and bad actors ignore it; it is a protocol, not a firewall.

Does blocking Google-Extended hurt my rankings?

No. It only opts you out of Gemini training data. Googlebot — the search crawler — is unaffected.

Where exactly does the file go?

The domain root: https://yoursite.com/robots.txt. Subdomains need their own file.

Do I even need one?

Without it, everything crawlable gets crawled — fine for tiny sites. You still want one for the sitemap line and the AI policy alone.

Before you save that file

Robots.txt is twenty lines that steer everything crawlers do on your site — worth five careful minutes. Generate yours with the free robots.txt generator, pair it with a proper XML sitemap, and control the index page-by-page with the meta tag generator — all free in our SEO tools hub.

Free tools for this

Built here, run in your browser, no sign-up.

How to use Robots.txt Generator

  1. 1Choose which crawlers to allow or block.
  2. 2Add any paths you want kept out of the index.
  3. 3Add your sitemap URL.
  4. 4Copy the file and upload it to your site root.

Why use our Robots.txt Generator?

No Upload, No Wait

Everything runs on your own device, so there is no queue and no server round-trip.

Genuinely Private

What you enter never leaves your browser. We could not see it even if we wanted to.

No Registration

No account, no email, no usage limit. Open it and use it.

Works Everywhere

Any modern browser on desktop, tablet or phone. Nothing to install.

Tools that pair with this one

The ones people usually reach for in the same sitting. All free, all in your browser.

Scroll to Top