XML Sitemap

An XML sitemap is a file that lists the URLs on your website you want search engines to crawl and index. It acts like a map for crawlers, helping them discover pages, especially new ones and those that are poorly linked.

What an XML sitemap contains

Each entry in a sitemap includes the page URL and, optionally, the date it was last modified. Large sites use a sitemap index file that links to several smaller sitemaps, for example one for pages, one for posts and one for products. A single sitemap can hold up to 50,000 URLs.

Specialised sitemaps exist for images, videos and news, and Hreflang annotations for international sites can also be placed in sitemaps.

Do you need an XML sitemap?

Google can find pages through links alone, but a sitemap is strongly recommended if:

  • Your site is new and has few external links.
  • Your site is large, with thousands of pages.
  • You publish new content often.
  • Some pages are not well linked internally.

For small, well-linked sites the benefit is smaller, but a sitemap still helps you monitor indexing in Google Search Console.

What to include and exclude

Include only pages you want to appear in search results:

  • Include: canonical, indexable pages returning a 200 status code.
  • Exclude: redirected URLs, 404 pages, pages with a Noindex Tag, duplicate or parameter URLs, and pages whose Canonical Tag points elsewhere.

A sitemap full of non-indexable URLs sends mixed signals and makes it harder to spot genuine indexing problems.

How to create a sitemap

Most content management systems generate one automatically. On WordPress, SEO plugins such as Rank Math or Yoast create sitemaps at addresses like /sitemap_index.xml. Ecommerce platforms such as Shopify do the same. For custom sites, a developer can generate one dynamically or use a crawler to create it.

How to submit your sitemap

  1. Open Google Search Console and go to Sitemaps.
  2. Enter the sitemap URL and click Submit.
  3. Add the sitemap location to your Robots.txt file so other search engines find it too.
  4. Submit it in Bing Webmaster Tools as well.

How to use the Sitemaps report

After submission, Search Console shows whether Google could read the sitemap and how many URLs it discovered. Combine this with the Pages report, filtered by sitemap, to see which submitted URLs are indexed and why others are not. This is one of the quickest ways to find indexing problems on important pages.

Common sitemap errors

  • Couldn’t fetch: the URL is wrong, blocked or returns an error.
  • Submitted URL marked noindex or blocked by robots.txt: remove those URLs or fix the conflict.
  • Submitted URL not found (404): clean up deleted pages.
  • Outdated lastmod dates, or dates that change on every request, which make the field useless to Google.

If you need to remove an old or duplicate sitemap from Search Console, follow my guide on how to remove a sitemap XML in Google Search Console.

Sitemaps are a hint, not a command

Listing a URL in a sitemap does not guarantee it will be crawled or indexed. Google still decides based on quality and importance, so pair your sitemap with strong Internal Linking and helpful content.

Further reading: Google’s guide to sitemaps.

Key Takeaways

  • An XML sitemap lists the URLs you want search engines to index.
  • Include only canonical, indexable pages that return 200.
  • Submit it in Search Console and reference it in robots.txt.
  • Use the Sitemaps and Pages reports to monitor indexing.
  • A sitemap is a hint; strong internal links still matter.

Related Terms

Wondering what to fix first on your site? Get a free check of your site’s SEO, or keep learning in the SEO Encyclopedia.