XML Sitemaps: The Complete Guide for SEO

XML Sitemaps: The Complete Guide for SEO

An XML sitemap is a file that lists the URLs you want search engines to crawl and index. It does not guarantee indexing, but it helps search engines discover new and updated pages faster, especially on large sites, new sites and sites with weak internal linking.

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/blog/my-post/</loc>
    <lastmod>2026-10-15</lastmod>
  </url>
</urlset>

Only loc is required. Google uses lastmod when it is accurate and ignores priority and changefreq.

What to include and what to leave out

  • Include canonical URLs that return a 200 status and that you want in search results.
  • Leave out redirects, 404s, noindex pages, URLs blocked by robots.txt, duplicates with parameters and non-canonical versions.
  • A sitemap full of URLs that Google cannot index sends mixed signals and wastes crawl time.

Limits and sitemap indexes

Each sitemap file can contain up to 50,000 URLs and weigh up to 50 MB uncompressed. Larger sites split their URLs into several sitemaps and list them in a sitemap index, which is what WordPress SEO plugins do with sitemap_index.xml: one sitemap for posts, another for pages, another for categories and so on.

Accurate lastmod dates

Update lastmod only when the content of a page really changes. If every page shows today’s date every day, Google learns to ignore the field.

How to submit a sitemap

  1. Add a Sitemap: line to your robots.txt so every search engine can find it.
  2. Submit it in Google Search Console, under Sitemaps, and in Bing Webmaster Tools.
  3. Check the report a few days later: it shows how many URLs were discovered and any errors.

Validate any sitemap and find common problems with our XML Sitemap Validator.

Other sitemap types

  • Image sitemaps help Google discover images, useful when images load with JavaScript.
  • Video sitemaps add details such as duration and thumbnail.
  • News sitemaps are for publishers in Google News and should only include articles from the last two days.

Frequently asked questions

Does a sitemap improve rankings?

No. It helps search engines find and recrawl pages, which can speed up indexing, but it does not make a page rank higher.

Do small sites need a sitemap?

It is not essential if your internal linking is good, but it costs nothing and WordPress creates one automatically.

Why does Search Console say ‘Discovered, currently not indexed’?

Google knows the URL but has not crawled or indexed it yet, often because it considers the page low priority. Improve internal links and content quality.