Robots txt generator cropped

Start from an example:

robots.txt is not a security mechanism — it does not prevent access to private content. It is a polite request that well-behaved crawlers follow; anyone can still open a disallowed address directly. To keep something private, protect it with a password or authentication instead. Crawler support for individual directives varies: Crawl-delay is ignored by Googlebot, and some crawlers ignore robots.txt entirely.

What Is the Robots.txt Generator?

A Robots.txt Generator builds the robots.txt file that tells search-engine crawlers which parts of your website they may visit. You add user-agent groups, write Allow and Disallow rules, set an optional crawl-delay and add your sitemap address, and the tool produces a clean, valid file you can copy or download. It is free, needs no sign-up, and runs entirely in your browser, so nothing leaves your device.

Every website has a robots.txt file at its root — yoursite.com/robots.txt — and every well-behaved crawler reads it before it starts. It is how you keep Googlebot out of your admin area, stop crawlers wasting time on search-result pages and login screens, and point them at your sitemap so they find your important pages faster. Writing the file by hand is easy to get wrong: one rule in the wrong place can block your whole site from search results. This tool builds the file from your choices, checks each rule as you type it, and warns you about anything invalid before it goes in.

One thing to understand before you start: robots.txt is a polite request, not a lock. It does not prevent access to private content — anyone can still open a disallowed address directly. To keep something private, protect it with a password or authentication instead.

How to Use the Robots.txt Generator

  1. Start from an example, or from scratch. Three buttons sit at the top: “Allow everything”, “Block everything” and “WordPress (typical)”. The WordPress example is a good starting point for most WordPress sites — it allows /wp-admin/admin-ajax.php (which the admin area needs) and disallows the rest of /wp-admin/. The tool already loads this example when you open it.
  2. Add a user-agent group. A group starts with a user-agent — * means every crawler — and then holds the rules for that crawler. Click “Add a user-agent group” to add another one, for example a group for Googlebot with different rules from the group for everyone else.
  3. Write your rules. Each group has Allow and Disallow rows. Type a path starting with /, for example /wp-admin/ or /private/. The tool only emits valid rules: a rule that does not start with / or that contains a space is warned about and left out of the file, so a typo can never produce a broken rule.
  4. Set a crawl-delay if you need one. Each group can carry an optional crawl-delay in seconds, which asks the crawler to wait that long between requests. Note that Googlebot ignores crawl-delay, and some crawlers ignore robots.txt entirely — support for individual directives varies.
  5. Add your sitemap. The “Sitemap URL” field holds the full address of your sitemap, starting with http:// or https:// — the default is https://allabouthtml.com/sitemap.xml. Leave it empty to leave it out.
  6. Copy or download. The live preview on the right updates as you work, so you always see the finished file. Click Copy to put it on your clipboard or Download to save it as robots.txt, then upload it to the root of your site.

Worked example

Say you run a WordPress site and want to keep crawlers out of the admin area while letting them read everything else. Click “WordPress (typical)”. The tool builds one group for * with Allow: /wp-admin/admin-ajax.php and Disallow: /wp-admin/, plus the sitemap line. Now add a second group: click “Add a user-agent group”, set the user-agent to * again — or to a specific crawler — and add a Disallow rule for /search/, so crawlers stop indexing your internal search-result pages. The preview now reads:

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

User-agent: *
Disallow: /search/

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

Click Download, upload the file to your site’s root so it is reachable at yoursite.com/robots.txt, and the crawlers will read it on their next visit.

Where a Robots.txt File Actually Helps

Keeping crawlers out of the admin area. The admin screens of a WordPress site, a login page, a checkout flow and a shopping cart have no business in search results. Disallowing them keeps crawlers from wasting their crawl budget on pages that should never rank, and keeps those pages out of the index.

Stopping duplicate and junk pages from being indexed. Internal search results, filtered product listings, print versions and tag archives can create hundreds of near-identical pages. A few Disallow rules keep crawlers focused on the pages that matter instead of burning their budget on copies.

Pointing crawlers at your sitemap. The Sitemap: line at the end of the file tells crawlers exactly where your sitemap lives. It is the simplest way to make sure new and updated pages are discovered quickly, and it costs one line.

Tips for a Robots.txt File That Works

  • Test the file before you upload it. Read the preview line by line. The most expensive mistake in SEO is a single wrong rule — Disallow: / blocks your entire site from every crawler. The tool’s rule check catches malformed rules, but it cannot know your intent, so read the finished file once before you publish it.
  • Allow the things your pages need. A common error is blocking the folders that hold your CSS, JavaScript and images. Search engines render pages like a browser does, and if they cannot fetch your styles and scripts they may judge the page wrongly. If you disallow a folder, make sure it does not hold assets your pages need.
  • Remember that Disallow is a request, not security. A disallowed page is still reachable by anyone who types the address, and it can still appear in search results if other sites link to it. Never put anything genuinely private behind a robots.txt rule — use a password or authentication.
  • Use specific groups sparingly. Most sites need one group for * and nothing else. Add a second group only when a particular crawler genuinely needs different treatment, for example to slow down an aggressive bot with a crawl-delay. More groups mean more chances to make a mistake.
  • Keep the sitemap line current. If your sitemap moves or you switch to a sitemap index, update the Sitemap: line to match. A stale sitemap address is worse than none at all, because it sends crawlers to a file that no longer exists.

Frequently Asked Questions

What is a robots.txt file?

It is a small text file that lives at the root of your website — yoursite.com/robots.txt — and tells search-engine crawlers which parts of the site they may visit. It is made of user-agent groups, each with Allow and Disallow rules, plus optional lines like Crawl-delay and Sitemap:. Well-behaved crawlers read it before they start crawling.

Will robots.txt keep a page private?

No. It is a polite request that well-behaved crawlers follow; anyone can still open a disallowed address directly, and a disallowed page can still show up in search results if other sites link to it. To keep something private, protect it with a password or authentication instead.

What is the difference between Allow and Disallow?

Disallow tells crawlers not to visit the paths listed, and Allow makes an exception inside a disallowed path. The classic example is the WordPress preset: Disallow: /wp-admin/ keeps crawlers out of the admin area, while Allow: /wp-admin/admin-ajax.php lets them fetch the one admin file the site itself needs. Rules must start with / and contain no space, or the tool warns you and leaves them out.

What does Crawl-delay do?

It asks a crawler to wait a number of seconds between requests, which is useful if a bot is hammering your server. But support varies: Googlebot ignores crawl-delay entirely, and some crawlers ignore robots.txt altogether. If Googlebot is crawling too aggressively, use Google Search Console’s crawl settings instead.

Where do I put the file after I download it?

Upload it to the root of your website, so it is reachable at yoursite.com/robots.txt. That is the only place crawlers look for it. A robots.txt file in a subfolder is ignored. After uploading, open the address in your browser to check it loads, and test it in Google Search Console’s robots.txt tester.

Conclusion

A robots.txt file is a few lines of text, but it decides what search engines see of your site — and one wrong rule can hide the whole thing. This Robots.txt Generator builds the file from your choices, validates every rule, and shows you the finished result live, so you can be sure of what you are publishing. Try it above, and when the file is in place, the XML Sitemap Generator is the matching tool for the sitemap it points to.

Related Tools