Skip to content

Guide

How to create and submit a sitemap to Google Search Console

2 min readPublished

An XML sitemap is a file that lists the URLs on your site that you want search engines to know about. It helps Google discover pages, especially new ones and ones with few links pointing to them. It does not make Google index them.

What belongs in a sitemap

  • Only canonical URLs: the version of each page you want in search.
  • Only pages that return 200 and can be indexed. Leave out redirects, 404s and noindex pages.
  • The full, absolute URL, with the same protocol and host you use everywhere else.
  • An accurate lastmod date, if you include one. Google uses it only when it has proven reliable, so do not set it to “now” on every build. changefreq and priority are ignored.

Size limits

One sitemap file can hold up to 50,000 URLs or 50 MB uncompressed. For more, split the URLs into several files and list them in a sitemap index file, then submit the index.

Creating one

Most CMSs and frameworks generate a sitemap for you, often at /sitemap.xml. If you build it yourself, the format is simple:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> containing one <url> per page, each with a <loc> and optionally a <lastmod>.

Submitting it

  1. Open Google Search Console and choose your property.
  2. Go to Indexing → Sitemaps.
  3. Enter the sitemap’s URL, for example sitemap.xml, and press Submit.
  4. Also add a line to robots.txt so every crawler can find it: Sitemap: https://example.com/sitemap.xml.

Reading the report

  • Success means Google fetched and parsed the file.
  • Couldn’t fetch means the URL is wrong, blocked or returned an error.
  • Discovered URLs is how many URLs Google found in it. It is not the number indexed. For that, use the Page indexing report.

What a sitemap cannot do

A sitemap is a hint about what exists. It cannot force indexing, fix a noindex tag or a robots.txt block, or make a thin page worth indexing. See why a page is not indexed for what does decide it.

IndexMeNow can import the URLs from a sitemap or a sitemap index, so you can scan them all for indexing problems in one go.