All posts
SEO Basics

What Is an XML Sitemap? (And Why Your Website Needs One)

A plain-English explanation of XML sitemaps — what they are, how search engines use them, and when your site actually needs one.

June 22, 2026·5 min read

If you've ever set up a website and wondered whether you need a sitemap, the short answer is: probably yes. The longer answer depends on the size of your site, how it's built, and how quickly you publish new content. This guide explains what an XML sitemap actually is, how search engines use it, and how to tell whether your site needs one.

What Is an XML Sitemap?

An XML sitemap is a file that lists every important page on your website in a format search engines can read quickly. The name comes from two things: XML (the data format) and sitemap (a map of your site's structure). The file lives on your web server, usually at a URL like https://yoursite.com/sitemap.xml.

A basic sitemap looks like this:

<?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>
  <url>
    <loc>https://example.com/blog/my-first-post</loc>
  </url>
</urlset>

Each <url> entry contains at minimum a <loc> tag with the full URL. You can optionally include <lastmod> (the date the page was last changed) and <priority> (a hint about which pages matter most), though Google largely ignores priority values in practice.

How Search Engines Use Your Sitemap

Search engines discover pages through two main methods: following links and reading sitemaps. When Googlebot visits your site, it follows every link it can find — from your homepage to your blog to your product pages. This works well for sites where everything is interconnected. But there are gaps.

Your sitemap fills those gaps. It gives Googlebot a definitive list of pages you want indexed, regardless of whether they can all be reached by following links. This is especially valuable for:

  • Large sites — if you have thousands of pages, crawlers may not reach all of them by link-following alone.
  • New pages — freshly published content may not yet have inbound links, so crawlers have no way to find it. A sitemap signals its existence immediately.
  • Orphaned pages — pages that exist but aren't linked from anywhere on your site won't be discovered without a sitemap.
  • JavaScript-heavy sites — single-page applications and sites that render content via JavaScript can be difficult for crawlers to parse. A sitemap provides a reliable fallback.

Does Your Site Actually Need a Sitemap?

Google is direct about this: if your site is small and all pages are linked from somewhere reachable, a sitemap is optional. But in practice, a sitemap costs almost nothing to create and has no downside, so most sites benefit from having one.

You almost certainly need a sitemap if:

  • Your site has more than a few hundred pages.
  • You publish new content frequently (blog posts, product listings, news articles).
  • Your site uses client-side rendering (React, Vue, Angular, Next.js SPA mode).
  • Some pages are not linked from your navigation or other pages.
  • You've recently launched or done a major redesign and want Google to re-index quickly.

You probably don't need one if your site is three pages with no plans to grow and every page is linked from the homepage. But even then, having one doesn't hurt.

XML Sitemap vs. HTML Sitemap

These are two different things that serve different purposes. An XML sitemap is for search engines — it's a machine-readable file they fetch directly. An HTML sitemap is a human-readable page (often found at /sitemap) that lists your site's sections and links for visitors who are lost.

For SEO purposes, the XML version is what matters. HTML sitemaps are a usability feature that can also provide crawlable links, but they're not a replacement for the XML file submitted to search consoles.

What a Sitemap Should (and Shouldn't) Include

Your sitemap should list every page you want indexed. It should not list pages you've deliberately blocked from indexing with a noindex tag or via your robots.txt file — including a URL in your sitemap while also blocking it sends a mixed signal to crawlers and wastes your crawl budget.

Leave these out of your sitemap:

  • Login and account pages (tag with noindex or block via robots.txt)
  • Duplicate content (pagination variants, filtered views, print versions)
  • Redirected URLs — always list the final destination, not the redirect source
  • 404 and 500 error pages

How to Get a Sitemap

There are three common ways to generate one:

  1. Built into your CMS — WordPress, Shopify, Webflow, and most modern platforms generate a sitemap automatically. Check your SEO plugin settings (e.g. Yoast, RankMath) or your platform's built-in sitemap feature.
  2. Generated by your framework — Next.js, Nuxt, and similar frameworks can generate sitemaps programmatically from your routes.
  3. Crawled by a tool — if you can't generate one from your codebase, a crawler like sitemapgenerator.ai discovers all public pages and produces the XML file for you.

Once you have the file, upload it to your web server and submit the URL to Google Search Console and Bing Webmaster Tools. This tells search engines where to find it rather than waiting for them to discover it by chance.

Try it free

Generate and check your sitemap in minutes

Crawl up to 2,000 URLs for free — no credit card required. See your health score and download your sitemap XML instantly.

Generate your sitemap →