XML sitemap

An XML sitemap is a machine readable list of URLs you want crawled and indexed. It helps search engines find your important pages and their latest change dates. For a small site, it speeds discovery and keeps stale URLs out of the crawl queue.

By , founder of Porteur · Updated 13 September 2026 · Markdown

Why XML sitemaps matter for a small site

Google can find pages from links. Your sitemap removes guesswork: it lists the canonical URLs that matter, and when each changed. On a small site you often add or rename pages by hand. A tidy sitemap means fewer missed pages and faster re crawls after edits.

What belongs in sitemap.xml, and what does not

  • Include only canonical, indexable URLs that return 200: for example https://yourproduct.com/pricing, not /pricing?ref=twitter.
  • Include unique content pages: home, features, pricing, docs like /guides/getting-started, blog posts, critical category pages.
  • Use lastmod to signal updates. Update the date when the primary content changes, not for minor CSS or typo fixes.
  • Exclude noindex, 404, 410, redirecting, duplicate, staging and parameter URLs.
  • Do not list pages blocked in robots.txt if you want them indexed later. Remove the block or leave them out.
  • Keep it small and clean. If your sitemap grows, split it into multiple files and reference them from a sitemap index as per sitemaps.org. This is the standard approach, typical, not measured on your site.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://yourproduct.com/pricing</loc>
    <lastmod>2026-10-10</lastmod>
  </url>
  <url>
    <loc>https://yourproduct.com/guides/getting-started</loc>
    <lastmod>2026-11-15</lastmod>
  </url>
</urlset>

How to create, host and validate your sitemap

  1. Create the file

    Most CMSs generate sitemap.xml for you. If not, script it from your URL list, or export from your router. Keep absolute URLs and ISO 8601 dates.

  2. Host it at a stable URL

    Serve it at https://yourproduct.com/sitemap.xml. If you use multiple sitemaps, create https://yourproduct.com/sitemap_index.xml referencing them.

  3. Declare it in robots.txt

    Add a line: Sitemap: https://yourproduct.com/sitemap.xml. This helps crawlers discover it without submission.

  4. Validate the XML

    Open it in a browser to catch obvious errors. Then use a sitemap validation tool or your own XML linter to confirm it follows the sitemaps.org schema.

  5. Keep it fresh

    Automate updates when you publish, unpublish or change canonical URLs. Remove dead URLs within a day of deprecating a page.

Submit and read it in Search Console

In Google Search Console, open Sitemaps. Enter the sitemap URL and submit. Google will fetch it and report discovery and parsing. Use the report to spot invalid URLs, last fetch time and any crawl issues tied to sitemap URLs.

  • Check coverage for sitemap URLs in the Indexing reports. Confirm the pages you listed are indexed.
  • If a URL shows Alternate page with proper canonical tag, remove the non canonical variant from the sitemap.
  • If you change structure, resubmit. You do not need to resubmit after routine updates, Google refetches.
  • Track key pages like /pricing and /blog in the report after content updates. A correct setup shows them discovered quickly and indexed soon after.

Common errors and quick fixes

  • Including noindex or redirected URLs. Fix by removing them and updating internal links.
  • Wrong canonical URLs. Ensure each sitemap URL has a canonical tag pointing to itself and returns 200.
  • Stale lastmod on active pages. Wire lastmod to your publish or update timestamp for primary content.
  • Mixing http and https or www and non www. Match your canonical scheme and host.
  • Large, slow files. Compress with gzip and split into logical sitemaps, for example /sitemap-pages.xml and /sitemap-posts.xml.
  • Blocked by robots.txt. If the sitemap URL or its targets are disallowed, lift the block or the sitemap will be ignored.

Questions

Sources

Check my site, free

Want to see if your sitemap covers the right pages and rivals beat you on key searches, from a URL, in about thirty seconds and free? Run the check.

  • Free check, no card
  • Read-only, your own accounts
  • Readable by your agent

Read next