Developer Guides

How to Generate an XML Sitemap for a Small Website

A practical guide to creating, checking, and submitting an XML sitemap for a small website—plus which pages to include and common mistakes to avoid.

How to Generate an XML Sitemap for a Small Website
On this page
  1. What an XML sitemap does
  2. Which pages should a small website include?
  3. How to generate an XML sitemap for a small website
  4. Should you add last modified dates?
  5. Common sitemap mistakes to avoid
  6. Frequently asked questions
  7. Does every small website need an XML sitemap?
  8. How many URLs should my sitemap contain?
  9. Where should I put sitemap.xml?
  10. Will an XML sitemap improve my rankings?
  11. How often should I update my sitemap?

To generate an XML sitemap for a small website, list the canonical URLs of the pages you want search engines to discover, format them in the sitemap XML structure, and save the file at a public URL such as https://www.example.com/sitemap.xml. Then check that it is valid and accessible, and submit its location through your search engine tools or reference it in your robots.txt file.

A small site usually needs just one sitemap. The important part is not listing every URL your website can produce; it is including the right pages, using their preferred versions, and keeping the file accurate when your site changes.

What an XML sitemap does

An XML sitemap is a file that gives search engines a structured list of URLs on your website. It can help crawlers discover pages, especially if your site is new, has few links pointing to it, or includes pages that are not easy to reach through navigation.

A sitemap is a discovery aid, not a promise that every listed page will be crawled or indexed. Search engines make their own decisions about crawling and indexing. A sitemap also does not replace useful internal links, clear navigation, or technically accessible pages.

Which pages should a small website include?

Include the preferred, public URLs of pages you want search engines to be able to index. For many small websites, that means the homepage, core service or product pages, important articles, and other useful landing pages.

Usually include Usually leave out
Canonical pages with useful content Redirecting URLs and URLs that return errors
Public pages you want discovered Login, account, cart, or private pages
The preferred version of each page Duplicate URLs, such as alternate tracking-parameter versions
Pages that are available to crawlers Pages blocked from indexing or intended to remain private

Use the same URL version your site treats as canonical. For example, do not mix http and https, or both www and non-www versions, if only one is the preferred address. Each sitemap entry should point directly to the final page rather than a redirect.

Do not add a page just because it exists. Search result filters, internal search pages, duplicate print views, and thin utility pages may not be useful sitemap entries. If you are unsure, ask whether the page is public, valuable to visitors, and intended to appear in search results.

How to generate an XML sitemap for a small website

  1. Choose the preferred website address. Confirm the live protocol and hostname, such as the HTTPS version of your domain. Use that consistent version for every URL in the sitemap.
  2. Collect the pages to include. Review your navigation, key landing pages, and published content. Remove duplicates, private URLs, redirects, and pages you do not want indexed. For a very small site, a simple page list or crawl of the site may be enough.
  3. Create the sitemap file. You can generate the XML yourself, use a website platform’s sitemap feature, or use a generator. ToolCMB’s Sitemap Generator is one option for creating a sitemap; review the resulting URLs before publishing it.
  4. Check the XML structure. A basic sitemap uses a urlset element, with each page inside a url element and its full address inside loc. For example:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/</loc>
  </url>
  <url>
    <loc>https://www.example.com/about/</loc>
  </url>
</urlset>
  1. Save it as an XML file. Name it something clear, commonly sitemap.xml. Keep the XML declaration and use UTF-8 encoding. If you create the file manually, make sure special characters in URL values are properly encoded and the XML elements are closed correctly.
  2. Upload it to your website. Put the file at a stable, public location, usually the root of your preferred domain. Open the sitemap URL in a browser to confirm that it loads without a login, error page, or redirect to an unexpected domain.
  3. Validate and submit it. Check that the file parses as XML and that every listed page loads at its final URL. Then submit the sitemap URL in the relevant search engine webmaster tools. You can also add a line like Sitemap: https://www.example.com/sitemap.xml to your robots.txt file.

Should you add last modified dates?

The optional lastmod element can tell search engines when a page was meaningfully updated. Add it only when you can provide a reliable date that reflects the page’s actual content change. Updating every date whenever the sitemap is regenerated can make this information less useful.

You do not need to add optional fields such as priority or changefreq just to make a sitemap work. Google says it ignores these values. Focus instead on accurate URLs, a valid file, and useful pages that can be crawled.

Common sitemap mistakes to avoid

  • Including non-canonical versions: List the preferred URL, not multiple versions of the same page.
  • Adding blocked or private pages: A sitemap should not be treated as a way to expose pages that are meant to stay private. Avoid listing them, and protect private content appropriately.
  • Listing broken or redirected URLs: Fix or remove URLs that lead to errors or another address.
  • Assuming submission guarantees indexing: Submission can help discovery, but it cannot force a search engine to index a page.
  • Forgetting to update the file: If your site changes, make sure newly published pages are included and removed pages are no longer listed.

For a small site, maintenance can be simple. If your website platform updates the sitemap automatically, check that the setting is enabled and review the output from time to time. If you manage a static site or update the file yourself, add new eligible pages and remove URLs when pages are permanently deleted or replaced.

Frequently asked questions

Does every small website need an XML sitemap?

Not necessarily. Search engines may discover a small, well-linked site without one. A sitemap is still a straightforward way to provide a list of important pages, especially for a new or recently updated site.

How many URLs should my sitemap contain?

Include the URLs you want search engines to discover, not every possible URL on your domain. A single sitemap supports up to 50,000 URLs or 50 MB uncompressed; a typical small site is well below those limits.

Where should I put sitemap.xml?

A common location is the root of your preferred domain, such as https://www.example.com/sitemap.xml. Make sure it is publicly accessible and that the listed URLs belong to the correct site version.

Will an XML sitemap improve my rankings?

A sitemap is primarily a discovery and crawling aid. It does not directly guarantee higher rankings, crawling, or indexing. The pages still need to be accessible and useful to searchers.

How often should I update my sitemap?

Update it when eligible pages are added, removed, or changed. Many content platforms do this automatically. If you maintain it manually, check it whenever you publish or make significant changes to your site.

Written by ToolCMB Team

We build fast, free and private browser tools — and write practical guides on how to use them.