Robots.txt Generator
Build a clean robots.txt file for your site in a minute — pick which search engines may crawl which parts, add your sitemap, and download the file. It runs entirely in your browser; nothing is uploaded.
Your file updates live as you change the rules.
What Is a Robots.txt File?
Every website has a small text file at its root called robots.txt, and every search engine reads it before crawling. It is a set of simple instructions: which crawlers may visit, which parts of the site they should skip, and where the sitemap lives. A typical file is only a few lines long, but those lines decide whether Google wastes its crawl budget on your admin pages and search results, or spends it on the pages that actually matter.
The file works with two ideas. A user-agent names the crawler the rule applies to — a star means all of them, while Googlebot or Bingbot target one engine. Allow and Disallow lines then name paths. “Disallow: /wp-admin/” tells crawlers to stay out of the WordPress dashboard, and “Allow: /wp-admin/admin-ajax.php” makes a small exception so the admin-ajax file, which some themes and plugins need, stays reachable. Paths are matched from the start, so “/wp-admin/” blocks everything under it. A sitemap line at the end points crawlers at your XML sitemap so they find new pages faster.
Most sites need only a short file. Block the admin area, the login page and internal search results — those pages add nothing to search results and can create thousands of thin, duplicate URLs. Keep images and uploads open so they can appear in image search. Add your sitemap. That covers the vast majority of WordPress sites, and it is exactly what this tool generates by default.
How to Use the Robots.txt Generator
- Pick a user-agent. Leave it on “All search engines” unless you have a rule for one crawler only.
- Adjust the rules. The defaults suit a WordPress site: admin blocked, admin-ajax allowed. Add a row for anything else you want to keep out, such as a staging folder or a private directory, and remove rows you do not need.
- Tick the extras. Blocking internal search results keeps thin search pages out of the index; allowing uploads keeps your images crawlable.
- Add your sitemap URL if you have one — for a WordPress site with Rank Math it is usually yourdomain.com/sitemap_index.xml.
- Copy or download the file and upload it to your site root, the same folder that holds wp-config.php. Then check it at yourdomain.com/robots.txt to confirm it loads.
Who Is This Tool For?
WordPress site owners setting up a new site or fixing crawl problems — pair it with our Meta Tag Generator to sort titles and descriptions at the same time, and read our WordPress SEO services guide for the wider on-page checklist. Bloggers who noticed Google indexing their search-result pages or admin URLs and want them gone. Developers putting a staging site live who need a quick “Disallow: /” while they work. And SEO beginners learning how crawlers see a site: the live preview makes each rule visible as you build it. If you are sorting your URLs more generally, our Slug Generator keeps every new address clean and readable.
Frequently Asked Questions
Where do I put the robots.txt file?
At the root of your site — the top-level folder, next to wp-config.php on WordPress. It must be reachable at yourdomain.com/robots.txt. A file buried in a subfolder will not be found.
Does robots.txt hide a page from Google?
Not reliably. It stops crawling, but if other sites link to the page, Google may still list its URL without any content. To keep a page out of search results properly, use a noindex tag or password-protect it.
Should I block my whole site while it is under construction?
Yes — a short file with “User-agent: *” and “Disallow: /” keeps search engines out until launch. Just remember to remove it (or replace it with a proper file) on launch day, or your site will stay invisible.
What is crawl-delay, and should I set one?
It asks a crawler to wait a number of seconds between requests. Google ignores it, and most sites never need it. Leave it blank unless a crawler is hammering a small server.
Can a bad robots.txt hurt my rankings?
Yes — one wrong line can block your whole site or your sitemap. Always check the file at yourdomain.com/robots.txt after uploading, and test it in Google Search Console’s robots.txt tester before and after big changes.
