Skip to content
FreeToolsKit.app

Marketing & SEO guide

How to Create an XML Sitemap for a Small Website

8 min read · Updated 20 November 2026 · Uses XML Sitemap Generator & Validator

Quick answer

An XML sitemap should list only the pages you want to appear in search results, each at its one preferred address: the full https:// URL, on the same host as the sitemap. Leave out sorted or filtered duplicates, http:// copies, pages on another host, URLs that redirect, and pages marked noindex. Add a last-modified date only when you know when the page last changed in a meaningful way.

To make and check the file in FreeToolsKit's XML Sitemap Generator & Validator:

  1. Paste your page URLs, one per line, under Generate sitemap, and enter where the sitemap will live.
  2. Fix any errors the tool lists, then choose Download sitemap.xml.
  3. Paste the downloaded file into Validate XML and choose Validate XML before you upload it.

The tool checks the format, the host, the protocol and the dates. It never visits your pages, so it can't tell you whether a URL redirects, is marked noindex or is a duplicate. You decide that before you paste.

The example site used in this guide

The test used a fictional pottery studio site at https://www.example.com and ten candidate addresses, the kind you might collect from your website software and menus. Paths below are on www.example.com unless another host is shown:

  • / (home page): last changed 2026-10-28. Include.
  • /classes: last changed 12 November 2026, but exported as 12/11/2026. Include, with the date fixed.
  • /shop: last changed 2026-11-14. Include.
  • /shop?sort=price: the same shop list sorted by price. Its canonical tag points to /shop. Leave out.
  • /product.php?id=42&cat=mugs: a product page whose only address has a query string, with a canonical tag pointing to itself. Include. Its & tests escaping.
  • /contact on http://: redirects to the https:// address. Leave out.
  • /contact on https://: no reliable last-changed date. Include, without a date.
  • shop.example.net/gift-cards: gift cards sold on another company's host. Leave out.
  • /workshops: an old page that now redirects to /classes. Leave out.
  • /thank-you: an order confirmation page with a noindex tag. Leave out.

That leaves five URLs for the sitemap.

XML Sitemap Generator & ValidatorFree to use · No account required · Runs in your browserOpen XML Sitemap Generator & Validator

Decide which URLs go in

Check each candidate against these rules:

  • One preferred address per page. Google's advice is that if "you have the same content accessible under different URLs, choose the URL you prefer and include that in the sitemap instead of all URLs that lead to the same content" (Google Search Central: Build and submit a sitemap). Pages listed in a sitemap are "suggested as canonicals", so don't list one URL in the sitemap while the page's canonical tag names another (Google Search Central: How to specify a canonical URL). That rules out /shop?sort=price.
  • Full URLs, one protocol, one host. Write each address in full, with https://. Under the sitemap protocol, every URL "must use the same protocol" and "reside on the same host as the Sitemap" (sitemaps.org: Sitemaps XML format). That rules out the http:// contact page and the gift-card page.
  • No redirects. Google says "Redirect URLs are not indexed, only the redirect target" (Search Console Help: Page indexing report). List the page the redirect lands on instead. To check a URL, open it in a browser and see whether the address changes.
  • No noindex pages. The same Google page names "a sitemap that includes URLs that are blocked for crawling by robots.txt, noindex, or a login requirement" as a cause of indexing errors. To check, search the page source or the response headers for the word "noindex".

Generate the sitemap

  1. In the tool, stay on the Generate sitemap tab.
  2. Paste your URLs into Page URLs — one per line. To add a date, put it after the URL, separated by a tab or spaces, as YYYY-MM-DD. The help text says the tool "never adds today's date for you".
  3. In Where will this sitemap live? (optional), type the address the file will have, such as https://www.example.com/sitemap.xml. With it, the tool checks that every URL shares that protocol and host and sits in that folder or below.
  4. Read the Errors list. Each error names its line, and the XML stays hidden until every error is fixed.
  5. Choose Download sitemap.xml. Copy XML copies the same text instead.

What the generator caught, and what it couldn't

First, all ten candidate lines went in unchanged, with the location set. The counter read "10 URLs of 5,000 · no output yet", and the tool listed three errors:

  • Line 2: "“12/11/2026” isn't a W3C date. Use YYYY-MM-DD, or a date-time with a time zone such as 2026-10-15T09:30:00+00:00."
  • Line 6: "Uses http:// but the sitemap location uses https://. Under the sitemap protocol, entries share the sitemap's protocol."
  • Line 8: "Not on the sitemap's host (www.example.com). A sitemap normally lists URLs from its own host only."

The sorted duplicate, the redirected /workshops page and the noindex thank-you page passed without comment. That's expected: the tool's own notice says it "can't tell whether a URL exists, is indexable or is canonical". A clean result means the file is well formed, not that every URL belongs.

Next, the five URLs that belong went in, with the class date corrected to 2026-11-12. There were no errors or warnings, and the download confirmed "sitemap.xml downloaded (579 bytes)".

Python's XML parser then confirmed the downloaded file's contents:

  • Root and namespace: a <urlset> element in the standard sitemaps.org namespace.
  • Entries: five <url> entries, each with one <loc>. Four have a <lastmod> in YYYY-MM-DD form, and the contact page has none.
  • Escaping: the product URL is written with &amp; in place of &, and the parser reads it back as the original address. The protocol requires this: "All data values in a Sitemap must be entity-escaped" (sitemaps.org: Sitemaps XML format).
  • No extras: no <priority> or <changefreq> elements.

Check a sitemap before you submit it

On the Validate XML tab, paste the file into Sitemap or sitemap index XML, add the address under Sitemap location (optional), and choose Validate XML. The downloaded file gave "No errors or warnings found by the local checks. This doesn't prove the URLs exist, are canonical or will be indexed." The summary showed 5 URLs, 5 valid entries and 0 entries with errors.

To see what a broken file looks like, the test also pasted a hand-written sitemap with three mistakes: a bare & in the product URL, the relative address /classes, and the gift-card page on another host.

  • First run: only one error appeared, "The XML isn't well-formed: error on line 8 at column 55: Unexpected token inside entity: =". The document type read "Not determined" and the URL count was 0. A bare & stops the file being read as XML at all, so the other mistakes stayed hidden. That error text came from Chrome's XML parser, so other browsers may word it differently.
  • After escaping the &: the relative URL showed as an error, "Entry 3: Use an absolute URL that starts with https:// or http://.", and the other host as a warning for entry 4. The validator treats another host as a warning rather than an error, because Google accepts cross-site sitemaps when you've verified ownership of both sites (Google Search Central: Build and submit a sitemap).

So fix syntax errors first, then validate again until the report shows the result you expect.

lastmod, priority and changefreq

Google says it "ignores <priority> and <changefreq> values" (Google Search Central: Build and submit a sitemap). Bing says both "are ignored by Bing and do not influence how your content is crawled or ranked" (Bing Webmaster Blog, July 2025). The generator doesn't write them. When the broken test file included them, the validator accepted them and noted "Valid under the protocol, but Google ignores changefreq", and the same for priority.

<lastmod> is different. Google uses it only if it's "consistently and verifiably" accurate, and a changed copyright date doesn't count as an update (Google Search Central: Build and submit a sitemap). The date must be "the date the linked page was last modified, not when the sitemap is generated" (sitemaps.org). Bing found that the most common lastmod fault is identical dates on every URL (Bing Webmaster Blog, February 2023).

  • Format: use a W3C date such as 2026-11-12. A date and time with a time zone is also valid, and Bing recommends one (Bing Webmaster Blog, July 2025), but add a time only when you know it.
  • Unknown date: leave lastmod out for that page, as the example did for the contact page.

Size limits

One sitemap may hold "no more than 50,000 URLs" and must be "no larger than 50MB (52,428,800 bytes)" uncompressed (sitemaps.org), and Google applies the same limits (Google Search Central: Build and submit a sitemap). A larger site splits its URLs into several sitemaps and lists them in a sitemap index, which the tool's Sitemap index tab builds. The tool itself handles up to 5,000 entries and 5 MiB per file. That's a browser limit, not a protocol rule.

Upload and submit it

  1. Upload the file to your site's root, so it's at an address like https://www.example.com/sitemap.xml. A sitemap covers only URLs in its own folder and below (sitemaps.org). Open that address in a browser to check it loads.
  2. Add a Sitemap: line to robots.txt with the sitemap's full URL. Google says "We will find it the next time we crawl your robots.txt file", and you can list more than one sitemap (Google Search Central: Build and submit a sitemap). The Robots.txt Generator & Validator can add the line. Bing also reads the line, or you can submit the sitemap in Bing Webmaster Tools (Bing Webmaster Blog, July 2025).
  3. Submit it in Google Search Console if you want to follow it there. Submitting means "telling Google where to find the file", and the Sitemaps report "shows only sitemaps that were submitted using this report or the API", not ones found through robots.txt (Search Console Help: Sitemaps report).

Don't rely on the old ping address. Google retired its sitemap "ping" endpoint, and requests to it now return a 404 error (Google Search Central Blog, June 2023). Submitting is also "merely a hint" (Google Search Central: Build and submit a sitemap), and the report's count of discovered pages comes with "no guarantee" that they will be crawled or indexed (Search Console Help: Sitemaps report).

Does a small site need a sitemap?

Not always. Google says you might not need one if your site has "about 500 pages or fewer" and is "comprehensively linked internally", so that every important page can be reached from the home page (Google Search Central: What is a sitemap). A sitemap helps more when a site is new and has few links from other sites.

For a five-page site like the example, a sitemap is optional but quick to make. If you keep one, update it and validate it again whenever you add, move or remove pages.