Robots.txt & Sitemap.xml Generator
Build a valid robots.txt file to control search engine crawling, or a sitemap.xml file listing your pages for indexing — both generated instantly from simple form fields, ready to copy and upload.
Each group targets one or more user-agents. Use * to target all crawlers.
Generated robots.txt
Save this as a plain text file named exactly robots.txt and upload it to your site's root directory.
Generated sitemap.xml
Save this as sitemap.xml and upload it to your site's root, then submit the URL in Google Search Console.
What do robots.txt and sitemap.xml actually do?
robots.txt is a plain text file at your site's root that tells search engine crawlers which parts of your site they're allowed or not allowed to access. It's a request, not a security measure — well-behaved crawlers like Googlebot respect it, but it doesn't prevent a page from being indexed if other pages link to it, and it should never be relied on to hide sensitive content.
sitemap.xml is the opposite: a list of URLs you want search engines to know about and crawl, optionally with metadata like how recently each page changed. It doesn't guarantee indexing, but it helps search engines discover pages faster, especially on large or newly-launched sites.
Common robots.txt mistakes to avoid
- Accidentally blocking your entire site with
Disallow: /underUser-agent: * - Blocking CSS or JS files search engines need to render your pages properly
- Using robots.txt to try to hide sensitive pages — use noindex tags or proper authentication instead
- Forgetting to update the sitemap URL if you migrate domains
Frequently Asked Questions (FAQ)
- Q. Do I need both files?
- A. Not strictly. Many sites run fine with just a sitemap and no custom robots.txt (search engines will crawl everything by default). robots.txt becomes useful once you need to restrict specific sections, like admin areas or duplicate filtered pages.
- Q. Where does robots.txt need to live?
- A. Exactly at your domain root —
www.example.com/robots.txt. It won't be recognized anywhere else, including subfolders. - Q. Will blocking a page in robots.txt remove it from Google's index?
- A. Not necessarily. If other sites link to a blocked page, Google can still index the URL
without crawling its content. To fully remove a page from search results, use a
noindexmeta tag instead (on a page that robots.txt does NOT block, so Google can actually see the noindex instruction).