Spider SEO Auditor
Technical SEO

How to create an XML sitemap and submit it to Google

How to create an XML sitemap and submit it to Google

An XML sitemap is a file that lists the URLs you want search engines to crawl and index. It helps Google discover new and updated pages faster, especially on large sites, new sites and pages with few internal links. Publish it at /sitemap.xml, list it in robots.txt, and submit it in Google Search Console.

What does a sitemap look like?

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/</loc>
    <lastmod>2026-10-01</lastmod>
  </url>
  <url>
    <loc>https://www.example.com/pricing</loc>
    <lastmod>2026-09-14</lastmod>
  </url>
</urlset>
A sitemap index linking to section sitemaps
Larger sites split their sitemap by section and list them all in a sitemap index.

Which pages belong in the sitemap?

Only the canonical, indexable version of pages you want in search: pages that return status 200, are not noindex, and are not redirected. Leave out duplicates, filtered or sorted URLs, login pages and thin utility pages.

What limits and tags matter?

  • One sitemap file can hold up to 50,000 URLs and 50 MB uncompressed. Larger sites use a sitemap index file that lists several sitemaps.
  • lastmod is useful when it is accurate: Google uses it if it consistently matches real changes.
  • Google ignores priority and changefreq.

How do you submit it?

  1. Add a line to robots.txt: Sitemap: https://www.example.com/sitemap.xml
  2. In Google Search Console, open Sitemaps and submit the URL.
  3. Do the same in Bing Webmaster Tools, which several AI assistants rely on.

Submitting does not guarantee indexing; it helps Google find the pages.

What are common sitemap errors?

ErrorFix
Sitemap URLs that redirect or return 404List only final, working URLs
Pages marked noindex in the sitemapRemove them, or remove the noindex
Important pages missingGenerate the sitemap from your CMS or database, not by hand
Sitemap blocked by robots.txtAllow it
lastmod set to today on every pageUse the real date each page changed

A site crawl compares the sitemap with the pages actually linked on the site, and finds orphan pages, missing pages and URLs that fail. Google's reference is Build and submit a sitemap.

Check this on your own site

Spider's free check tests this and about 100 other things on any page, and links each problem to a guide like this one.