Robots.txt Generator
Create a clean, valid robots.txt file without memorising the syntax. Choose a default rule for all crawlers, add specific paths to block or allow, include your XML sitemap and, if you want, set separate rules for named bots. Then copy the result or download it.
There is a WordPress preset that blocks the admin area while keeping the AJAX endpoint that many themes and plugins need.
- 100% free, no sign-up
- Runs in your browser
- Nothing you type is uploaded
Choose your rules
Your robots.txt
Upload it to the root of your domain, e.g. https://www.example.com/robots.txt
How to use this tool
Choose the default rule
Most sites should allow all crawlers. Only block everything on staging or development sites.
Add paths to disallow
Block areas with no search value, such as /wp-admin/, internal search results (/?s=) or cart and checkout pages.
Add your sitemap URL
Enter the full URL of your XML sitemap, for example https://example.com/wp-sitemap.xml, so crawlers can find it easily.
Copy and upload
Save the file as robots.txt in the root of your domain, so it is reachable at https://yourdomain.com/robots.txt.
Test it
Open the file in a browser, then check the robots.txt report in Google Search Console for errors.
What robots.txt can and cannot do
Robots.txt tells well-behaved crawlers which URLs they may crawl. It does not reliably keep a page out of search results. If other sites link to a blocked URL, Google can still index the address and show it without a description. To keep a page out of Google, allow crawling and add a noindex robots meta tag or X-Robots-Tag header instead. Google has to be able to crawl the page to see the noindex.
Robots.txt is also public and is not a security feature. Anyone can read it, and malicious bots ignore it. Never use it to hide private files. Protect them with a password or remove them from the web server.
Robots.txt syntax at a glance
| Directive | Example | Meaning |
|---|---|---|
| User-agent | User-agent: * | The rules below apply to all crawlers |
| Disallow | Disallow: /wp-admin/ | Do not crawl URLs starting with this path |
| Allow | Allow: /wp-admin/admin-ajax.php | Exception to a broader Disallow rule |
| Sitemap | Sitemap: https://example.com/wp-sitemap.xml | Location of your XML sitemap |
| Wildcards | Disallow: /*?s= | * matches any characters; $ marks the end of a URL |
Common mistakes to avoid
- Leaving "Disallow: /" in place after a staging site goes live, which blocks the entire site
- Blocking CSS or JavaScript folders that Google needs to render your pages
- Using robots.txt to remove pages from Google instead of noindex
- Placing the file in a subfolder; it only works at the root of the domain
- Expecting the Crawl-delay directive to work for Google; Googlebot ignores it
Frequently asked questions
Straight answers to the questions business owners ask us most.
Still have a question? Talk to us
Does every website need a robots.txt file?
No, it is optional. Without one, crawlers assume they can crawl everything. A simple file is still useful because it points crawlers to your sitemap and keeps them out of low-value areas such as admin screens and internal search results.
Will blocking a page in robots.txt remove it from Google?
Not reliably. Robots.txt stops crawling, not indexing. A blocked URL can still appear in results if other pages link to it. Use a noindex meta tag on a crawlable page to keep it out of search, or remove the page and return a 404 or 410 status.
What should a WordPress robots.txt contain?
A typical WordPress setup allows all crawlers, disallows /wp-admin/ while allowing /wp-admin/admin-ajax.php, and lists the sitemap. Do not block /wp-content/ or /wp-includes/, because Google needs the CSS and JavaScript in those folders to render your pages properly.
Can I block AI crawlers with robots.txt?
You can add rules for specific user agents that publish their names, such as GPTBot or Google-Extended. Compliance is voluntary, and blocking Google-Extended does not affect normal Google Search. Check each company's current documentation for its crawler names before relying on this.
Is my input saved?
No. The generator runs entirely in your browser, and the paths, sitemap URL and bot rules you enter are never sent to our server. The file is assembled on your device for you to copy or download. Refreshing the page clears everything, so save the finished robots.txt before you leave the page.
More free tools and services
Local Business Schema
Generate LocalBusiness JSON-LD with your address, hours and contact details.
SEO Company in Raipur
Technical fixes, content and links that move your website up Google for the searches your customers make.
Website Design Raipur
Fast, mobile-first websites and landing pages built to rank and to convert.
Want an expert to do this for you?
Free tools show you the gaps. We fix them: technical SEO, content, Google Business Profile and ads, done properly for your market.
- A plain-language review of your website and Google presence
- Quick wins you can act on straight away
- No obligation and no spam
Get your free audit
Takes under a minute.