ToolBrainy

ToolBrainy

The Complete XML Sitemap Guide (2026)

Written by

in

If Google can’t find your pages, it can’t rank them. An XML sitemap is the single simplest way to hand a search engine a clean, complete list of everything on your site worth indexing. This guide walks through exactly what a sitemap is, when it actually moves the needle, how to build one for any platform, and how to submit it the right way in 2026.

What is an XML sitemap?

An XML sitemap is a machine-readable file — almost always at /sitemap.xml — that lists the URLs on your site you want search engines to crawl and index. Each entry can include a few optional hints: when the page was last modified, how often it changes, and its relative priority.

Think of it as the index at the back of a book. Search engines can find your pages by following links, but a sitemap guarantees nothing important gets missed — especially deep pages, newly published content, or pages that aren’t linked from many places yet.

What a real sitemap looks like

A minimal, valid XML sitemap follows the sitemaps.org protocol and looks like this:

sitemap.xml

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

Only two things are required: the <urlset> wrapper with the correct namespace, and one <loc> per URL. Everything else is optional. In practice, <lastmod> is the one extra field worth keeping accurate — Google uses it as a hint for re-crawling. It largely ignores <changefreq> and <priority>, so don’t lose sleep over them.

Sitemap index files (for bigger sites)

A single sitemap can hold up to 50,000 URLs or 50 MB uncompressed, whichever comes first. Larger sites split their URLs across several sitemaps and tie them together with a sitemap index file:

sitemap-index.xml

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

This is exactly how WordPress, Yoast and most CMS platforms structure things by default: one index that points to separate sitemaps for posts, pages, categories and so on. You submit the index once and search engines discover the rest.

Do you actually need a sitemap?

Honest answer: a small, well-linked site (say, under 100 pages where everything is reachable from the menu) will get crawled fine without one. But a sitemap becomes genuinely valuable when:

  • Your site is large, or grows quickly.
  • You publish new content often and want it discovered fast.
  • Some pages aren’t well linked internally (orphan pages).
  • Your site is new and has few backlinks pointing in.
  • You have rich media (images, video) you want surfaced in the right places.

There’s no downside to having one, so the practical rule is simple: always publish a sitemap. It costs nothing and only helps discovery.

How to create an XML sitemap

WordPress

Since WordPress 5.5, core generates a sitemap automatically at /wp-sitemap.xml. If you use an SEO plugin (or the WPOS SEO engine), you’ll usually get a richer, cleaner sitemap at /sitemap.xml or /sitemap_index.xml. You rarely need to build one by hand.

Shopify

Shopify auto-generates /sitemap.xml for every store, split into products, collections, pages and blogs. It updates automatically — you just submit the URL.

Static or custom sites

For a hand-built site or a small custom app, the fastest route is a generator: paste your URLs (or your homepage to crawl) and download a ready-to-upload file. Our free XML Sitemap Generator does exactly this — no signup, and the file is built right in your browser.

How to submit your sitemap to Google

  1. Open Google Search Console and select your property.
  2. In the left menu, go to Sitemaps.
  3. Enter your sitemap path (e.g. sitemap.xml) and click Submit.
  4. Wait for the status to read Success — Google will report how many URLs it discovered.

You don’t need to resubmit every time you publish; search engines re-fetch known sitemaps on their own schedule. Submit once, then only revisit if you restructure the site.

Link your sitemap from robots.txt

Beyond Search Console, the other standard way to advertise your sitemap is a single line in your robots.txt file. Every major crawler reads it:

robots.txt

User-agent: *
Allow: /

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

This is the belt-and-suspenders approach: the Sitemap: directive means bots that never touch Search Console (Bing, DuckDuckGo, and AI crawlers) still find your sitemap. If you don’t have a robots.txt yet, our Robots.txt Generator can create one with the sitemap line already included. For the full breakdown, see our complete robots.txt guide.

Common sitemap mistakes

  • Listing non-canonical or redirected URLs. Only include the final, indexable version of each page. Never list URLs that 301/302 or 404.
  • Including noindexed pages. If a page is noindex, keep it out of the sitemap — mixing signals confuses crawlers.
  • Blocking the sitemap in robots.txt. Make sure you haven’t accidentally disallowed the path the sitemap lives on.
  • Stale lastmod dates. A lastmod that never changes is worse than none. Either keep it accurate or drop it.
  • Forgetting to update after a migration. After changing domains or URL structures, regenerate and resubmit.

Sitemaps vs robots.txt: what does what

These two files are often confused, but they do opposite jobs:

  • The sitemap says “here’s what I want you to crawl.” It’s an invitation.
  • robots.txt says “here’s what I don’t want you to crawl.” It’s a boundary.

Used together, they give search engines a clear map plus clear no-go zones. Neither one forces indexing — that’s still Google’s call — but together they make its job far easier.

The bottom line

An XML sitemap won’t magically boost your rankings, but it removes the biggest risk for a growing site: pages that never get discovered. Publish one, keep it clean (indexable, canonical URLs only), reference it from robots.txt, and submit it once in Search Console. Then get back to the work that actually moves rankings — great content and links.

Frequently asked questions

Where should my sitemap be located?

At the root of your domain, typically https://yoursite.com/sitemap.xml. It can technically live elsewhere if you submit it directly in Search Console, but the root is the convention every crawler expects.

How often should I update my sitemap?

If it’s generated automatically (WordPress, Shopify, most SEO plugins), it updates itself whenever you publish. For a hand-built file, regenerate it whenever you add or remove pages. You don’t need to resubmit each time — search engines re-crawl known sitemaps on their own.

What’s the maximum size of a sitemap?

50,000 URLs or 50 MB uncompressed per file, whichever comes first. Beyond that, split your URLs across multiple sitemaps and reference them from a single sitemap index file.

Do I need both an XML sitemap and a robots.txt?

Yes — they do different jobs. The sitemap lists pages you want crawled; robots.txt sets rules for what shouldn’t be crawled. Adding a Sitemap: line to robots.txt is the best-practice way to link the two.

Will a sitemap improve my Google rankings?

Not directly. A sitemap helps Google discover and crawl your pages faster and more completely, which is a prerequisite for ranking — but the ranking itself still depends on content quality, relevance and links.

Should I include images and videos in my sitemap?

You can, using the image and video sitemap extensions, if visual content is important to your traffic (e.g. a photography or recipe site). For most sites the standard URL sitemap is enough.

Related tools & guides

Written by

ToolBrainy Editorial Team

We build and test the free online tools featured across ToolBrainy — from PDF and image utilities to security and developer helpers. Every guide is written from hands-on use of these tools, checked for accuracy, and kept up to date so you get practical, no-nonsense advice you can actually apply.

Handy tools for this topic

70+ free tools, zero sign-up

Every ToolBrainy tool runs right in your browser — no accounts, no watermarks and no limits. Compress a PDF, generate a strong password, convert an image and plenty more.

Browse all tools