SEO & Webmaster4 min read•October 8, 2026

How to Generate a robots.txt File and a Starter XML Sitemap for Any Domain

Learn how to turn a base URL, a list of blocked paths and a list of page URLs into a ready robots.txt and sitemap.xml, and what each generated line means.

S
Developer and maintainer of SmartToolPack
Last Updated: October 8, 2026
Disclaimer: Calculations and results provided by this tool are mathematical estimates for informational and educational purposes only. They do not constitute professional financial, tax, or legal advice.
Featured Utility Tool

Robots.txt & Sitemap Generator

Open Robots.txt & Sitemap Generator

Introduction

Search engine crawlers look for robots.txt at the root of a domain before fetching anything else, and a sitemap tells them which URLs matter. A malformed file can hide an entire site or expose admin paths that should stay private. The Robots.txt & Sitemap Generator builds both files from a base URL, a short list of disallowed paths and the page URLs you want listed, updating the output in the browser as fields change.

Step-by-Step Instructions

  1. Enter the site root in the Domain / Website Base URL field, including https:// (a trailing slash is removed automatically).
  2. List each folder or path to block in Disallowed Path Rules, one per line, such as /admin/ or /private/.
  3. Review the robots.txt preview, which always starts with User-agent: * and Allow: / followed by your Disallow lines and a Sitemap directive.
  4. Click Copy above robots.txt and save the text as robots.txt in the web root.
  5. Paste the pages to include into Sitemap URLs, one per line (full URLs or paths such as /about/), optionally set Last Modified, Change Frequency and Priority, then click Copy above sitemap.xml and save it as sitemap.xml in the web root.

Key Use Cases

  • New site launch: Produce a valid robots.txt in seconds so the crawl is not blocked by a missing or broken file.
  • Staging cleanup: Add /staging/ or /test/ to the disallow list before the site goes public.
  • Small-site sitemap: Turn a list of page URLs into a valid, correctly escaped urlset without typing the XML namespace by hand.

Frequently Asked Questions

What exactly does the generated robots.txt contain?

It always writes User-agent: * and Allow: /, then one Disallow line per line in the paths box (leading and trailing spaces are trimmed and blank or whitespace-only lines are skipped), and finally Sitemap: pointing to /sitemap.xml under the base URL. There is no option to target a specific bot or add crawl delay.

Does the sitemap include all my pages?

Only the ones you list. The tool does not crawl the site, so it writes one url entry per line in the Sitemap URLs box, skipping blank lines and duplicates and escaping characters such as & as XML requires. Lastmod, changefreq and priority are added to every entry only when you set them; Google ignores changefreq and priority, so they are optional.

Is my domain sent anywhere?

No. Both files are assembled from the form values in the browser as you type. Nothing is uploaded, and the copy action only uses the clipboard.