How to create an XML sitemap and submit it to Google

Build a valid XML sitemap, decide which URLs belong in it, add it to robots.txt and submit it in Search Console. Includes the limits Google applies.

SEO2 min readUpdated

Key takeaways

  • A sitemap lists the canonical URLs you want found; it is a hint, not a guarantee of indexing.
  • One sitemap file holds up to 50,000 URLs or 50 MB uncompressed; larger sites use a sitemap index.
  • Google ignores priority and changefreq, and trusts lastmod only when it is accurate.
  • Submit it in Search Console and add a Sitemap: line to robots.txt.
On this page
  1. What a sitemap looks like
  2. Create one
  3. Which URLs belong in it
  4. Limits and tags Google ignores
  5. Tell search engines about it
  6. "Discovered" is not "indexed"

What a sitemap looks like

<?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-10-28</lastmod>
  </url>
  <url>
    <loc>https://example.com/services/</loc>
  </url>
</urlset>

Each page is a <url> entry with its full address in <loc>. The file must be UTF-8, and URLs must be absolute (starting with https://), because Google crawls them exactly as written.

Create one

  1. Open the sitemap generator.
  2. Paste your page addresses, one per line. Add a last-modified date if you know it.
  3. Download sitemap.xml and upload it to the root of your site, so it opens at https://yourdomain/sitemap.xml.

Most website builders and content systems (WordPress with an SEO plugin, Shopify, Wix, Squarespace) create a sitemap automatically. Check for one at /sitemap.xml or /sitemap_index.xml before you make your own.

Which URLs belong in it

  • Include pages you want in search results: the canonical version of each, returning a 200 status.
  • Leave out redirects, pages marked noindex, duplicates with a different canonical, error pages, search results and thank-you pages.
  • Pick one version of the domain. If your site redirects www to the bare domain, list only bare-domain URLs.

Limits and tags Google ignores

ItemWhat Google does
SizeUp to 50,000 URLs or 50 MB (uncompressed) per file. Split larger sites and list the files in a sitemap index.
<lastmod>Used when it is consistently accurate. Change it only for significant updates, not for a new copyright year.
<priority> and <changefreq>Ignored by Google. You can leave them out.

Tell search engines about it

  1. Search Console: open Sitemaps, enter sitemap.xml and submit. The report shows when Google last read it, how many URLs it discovered and any errors.
  2. robots.txt: add Sitemap: https://yourdomain/sitemap.xml on its own line. Bing and other engines read it there too. The robots.txt generator adds the line for you.
  3. Bing Webmaster Tools: you can import your sites from Search Console and the sitemap comes with them.

"Discovered" is not "indexed"

A sitemap helps Google find pages; whether they are indexed depends on their quality and usefulness. For a brand-new site, it is normal to see many pages "Discovered, currently not indexed" in the first weeks. Make sure sitemap URLs are not blocked by robots.txt (check with the robots.txt tester), link to important pages from your menu, and keep adding helpful content.

Sources

  1. Google Search Central: Build and submit a sitemapdevelopers.google.com
  2. Google Search Central: What is a sitemapdevelopers.google.com
  3. Search Console Help: Sitemaps reportsupport.google.com
  4. sitemaps.org: Sitemap protocolsitemaps.org
Written by the Toolkeel team at Sole Digital Media

Fact-checked against the sources above. We test every tool we mention. Editorial policy.