How to Create a sitemap.xml for a Small Website (Step by Step)

Your sitemap.xml is one of those files you only think about when something goes wrong: Google misses a new page, keeps crawling URL variants you don’t want indexed, or you realise your “sitemap” is really just a dump of everything your server can output.

This guide shows you how to create a sitemap.xml for a small website the clean way: start with a strict URL list (canonical, indexable, 200-status pages), turn it into valid XML you can sanity-check, then validate and submit it so Google can actually fetch it. You’ll also see when it’s worth doing it by hand (tiny static sites) versus using a generator, and what changes once you outgrow a single file and need a sitemap index to organise multiple sitemaps.

If you want the fastest route, you can generate a sitemap directly in your browser at https://hirebalzac.ai/free-seo-tools/sitemap-generator/ by pasting your URLs (no signup). Either way, the goal is the same: a sitemap that lists the pages you want to be found, and nothing else.

What Is a Sitemap XML (And What Should Be in It)?

Before you create sitemap xml files from a pasted URL list, you need a clear rule for what belongs in the file. A sitemap is useful when it reflects the pages you actually want Google to crawl and index, not every URL your site can generate.

At a basic level, a sitemap is of two types, XML and HTML. An XML sitemap is the machine-readable file you submit to search engines. The same source describes a Google Sitemap as primarily a text file listing the web addresses of every page on a website, and notes the sitemap protocol requires you to host it on your web server as an XML document.

An HTML sitemap is a human-facing page with links, usually meant to help visitors navigate. It can also help internal linking, but it is not the file Google Search Console expects when you submit a sitemap.

What Should Be in Your Sitemap XML

Put only URLs that meet all of these conditions:

  • Canonical: the preferred version of the page, not a parameter variant or duplicate.
  • Indexable: no noindex, no password walls, no blocked-by-robots pages.
  • 200 status: the URL loads successfully. Exclude redirects (3xx), missing pages (404), and server errors (5xx).

This inclusion rule keeps your sitemap generator output clean. It also prevents common problems like submitting redirected URLs, listing both HTTP and HTTPS versions, or including tag pages and filtered category pages that you never want indexed.

If you want to include freshness signals, an XML sitemap can also show when a site was last modified and how frequently it is modified, according to the same HTML / XML Sitemap Generator reference. Treat those fields as optional metadata, and keep the URL list accurate first.

What Does a Sitemap XML File Look Like? (urlset, loc, lastmod)

If you want to create sitemap xml by hand or sanity-check a sitemap generator’s output, you need to recognize the core tags. A sitemap.xml is an XML document that wraps a list of URLs inside a single container, then repeats the same small set of elements for each page.

At minimum, each entry needs a <loc> with the full canonical URL (including https). Everything else is metadata, and you should only add metadata you can keep accurate.

Basic Sitemap XML Structure (urlset, url, loc, lastmod)

Here is the smallest “correct enough” structure most small sites use:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
  </url>
  <url>
    <loc>https://example.com/about/</loc>
  </url>
</urlset>

The rules are simple: one <urlset> per file, one <url> block per page, one <loc> per <url> block.

You can add <lastmod> when you have a real “last modified” date for that exact URL. The Medium explanation of Google’s example notes that lastmod is not mandatory, so skip it if you cannot maintain it reliably.

Avoid relying on <priority> and <changefreq>. Google says it ignores both fields in sitemaps, as documented in Google Search Central’s “Build and submit a sitemap” guide. Put your effort into listing only canonical, indexable 200-status pages, with clean loc values.

Which Sitemap Generator Should You Use vs Doing It Manually?

When you create sitemap xml, the decision is simple: use a generator when you already have a clean URL list, and write it by hand when your site is tiny and rarely changes. Either way, the sitemap should only include canonical, indexable pages that return a 200 status code.

A generator helps most small sites because it removes formatting mistakes. You paste or export your final URLs, then the tool outputs valid XML with the required <urlset>, <url>, and <loc> tags. This route also makes it easier to regenerate the file whenever you publish new pages.

How to Choose a Sitemap Generator vs Manual Creation

  • Use a sitemap generator if you have more than a handful of pages, publish regularly, or want to avoid XML syntax errors. Generators are also safer when you need to normalize URLs (HTTPS, trailing slashes) before you submit to Google Search Console.
  • Do it manually if your site is truly small and stable. One reference suggests that if a website has less than 100 pages, you can create a sitemap manually. Manual work is fine for a simple static site where you control every URL.

If you want a fast, no-install option, use Balzac’s free sitemap generator at https://hirebalzac.ai/free-seo-tools/sitemap-generator/. It runs in the browser. You paste your canonical URLs, generate the XML, and download it, no signup required.

Manual creation still has one advantage: you decide exactly what gets listed. That matters when your CMS produces extra URLs like tag archives, internal search pages, or parameter variants. If you see those in your export, fix the URL list first, then generate the sitemap.xml.

How to Create Sitemap XML Manually for a Small Static Site

If you want to create sitemap xml for a small static site, manual editing works well because you control every URL. Start from a clean list of canonical, indexable pages that return a 200 status code. If your list includes tag archives, internal search URLs, or parameter variants, remove them before you write the XML.

  1. Collect your final URL list. Use the exact canonical URL you want indexed (usually the HTTPS version). Keep one URL per line in a scratch file so you can paste them in order.
  2. Open a plain-text editor. Use Visual Studio Code, Sublime Text, Notepad (Windows), or TextEdit in plain-text mode (macOS). Avoid Google Docs or Microsoft Word because they can add hidden formatting.
  3. Create the XML skeleton. Start with the XML declaration, then a single urlset container with the sitemap namespace.
  4. Add one url block per page. Each block needs a loc with the full URL. Add lastmod only if you can keep it accurate for that specific page.
  5. Save as UTF-8. Name the file sitemap.xml and save it with UTF-8 encoding so non-ASCII characters in URLs (if any) serialize correctly.

Here is a minimal template you can copy and fill:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>YYYY-MM-DD</lastmod>
  </url>
  <url>
    <loc>https://example.com/about/</loc>
  </url>
</urlset>

Upload And Verify Your Sitemap.xml

Upload sitemap.xml to your site root so it resolves at /sitemap.xml (for example, https://yoursite.com/sitemap.xml). Use whatever your stack supports: SFTP (FileZilla), your host’s file manager, or a static deploy flow like Netlify or Cloudflare Pages.

Verify it in a browser. You should see XML, not a 404, redirect chain, or an HTML error page. This quick check catches the most common “how to make a sitemap” mistakes before you submit it to Google.

How to Validate and Submit Your Sitemap to Google

If you can load sitemap.xml in a browser, you are close. Validation is the step that catches the quieter mistakes that break a create sitemap xml workflow: wrong URLs, blocked pages, and files Google cannot fetch.

  1. Confirm the sitemap URL resolves cleanly: open https://yoursite.com/sitemap.xml. It should return a 200 status and show XML, not a login page, redirect chain, or 404.
  2. Spot-check the URLs inside: pick a few <loc> values and open them. Each one should be canonical, indexable, and return 200 (no noindex, no redirects).
  3. Check robots.txt discovery: run your domain through Balzac’s free checker at https://hirebalzac.ai/free-seo-tools/robots-txt-checker/. Use it to confirm Googlebot is not blocked from fetching /sitemap.xml and that your robots.txt file is reachable.

Submit the Sitemap in Google Search Console

Submit your sitemap generator output in Google Search Console so Google can fetch it on demand. In Search Console, choose the correct property (Domain or URL-prefix), then go to Sitemaps, enter the sitemap path (for example sitemap.xml), and submit.

After submission, watch for two signals: Search Console should show the sitemap as “Success,” and it should list “Discovered URLs.” If Google reports errors, fix the sitemap file (or the URLs in it), re-upload, then resubmit.

Add a sitemap directive to robots.txt so crawlers can find it without Search Console:

Sitemap: https://yoursite.com/sitemap.xml

If you want a deeper walkthrough for finding the right sitemap URL and checking validity, follow this guide. Balzac also publishes new articles to your site, so your sitemap has pages to list.

When You Need Multiple Sitemaps: 50,000 URLs, 50 MB, and Sitemap Index Files

Your sitemap.xml stays simple until it gets big. Once it crosses Google’s limits, you stop thinking “one file” and start thinking “a set of files plus an index.” That shift matters if you publish a lot of pages, add new content sections, or generate many URLs from a CMS.

Google documents two hard limits per sitemap file: 50,000 URLs or 50 MB uncompressed. When you approach either limit, split your URL list into multiple sitemap files and reference them from a sitemap index. Keep the same inclusion rule from earlier sections: only canonical, indexable URLs that return a 200 status code.

How a Sitemap Index Organizes Multiple Sitemaps

A sitemap index is a separate XML file that lists multiple sitemap files so crawlers can discover them from one entry point.

In practice, you use a sitemap index when any of these are true:

  • Your single sitemap is close to 50,000 URLs.
  • Your sitemap file size grows toward 50 MB uncompressed (images and long URLs can push size faster than you expect).
  • You want clean separation by section, for example sitemap-pages.xml, sitemap-blog.xml, sitemap-products.xml, even if you are still under the limits.
  • Your publishing workflow benefits from updating one sitemap without rewriting the others.

Keep your setup boring and predictable: publish the index at something like /sitemap_index.xml, list each child sitemap inside it, then submit the index URL in Google Search Console. Add a matching Sitemap: directive in robots.txt that points to the index, not an individual child file.

If you are using Balzac to publish new articles automatically, splitting by section (for example, a dedicated blog sitemap) keeps your “how to make a sitemap” workflow stable as the site grows.

Sources

← All articles

Free AI visibility check

Is ChatGPT citing your site?

See if ChatGPT search and Google AI Overviews cite you for your top searches, and who they cite instead. About a minute, no account.

Want content like this on autopilot?

Balzac researches, writes and publishes articles like this one to your site. Every week.

3 free articles · No card needed