An XML sitemap is a file that lists every URL on your website along with optional metadata — last modified date, change frequency, and relative priority. It gives search engines a complete, machine-readable map of your site so they can discover and schedule crawls of pages that might not be reachable through normal link-following alone.

Category
Technical SEO
Also Called
Sitemap.xml
Difficulty
Beginner
Read Time
7 min

Every page on your site needs to be discovered before it can rank. An XML sitemap is the fastest, most reliable way to hand Google a complete index of everything you've published — especially for new sites, large sites, or pages with few internal links pointing to them.

What is an XML sitemap?

An XML sitemap is a plain-text file written in Extensible Markup Language (XML) format and hosted at a predictable URL — usually /sitemap.xml. It serves one purpose: tell search engines exactly which URLs exist on your site and give them hints about how important each URL is and how recently it changed.

The Sitemaps protocol, originally developed by Google in 2005 and adopted by Bing, Yahoo, and others, defines the schema. A basic sitemap entry looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/blog/seo-tips/</loc>
    <lastmod>2026-05-15</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>

Every field except <loc> is optional. Google has stated publicly that it mostly ignores changefreq and priority — so the URL itself and lastmod are the fields that matter most in practice.

Why XML sitemaps matter for SEO

Search engines discover pages primarily through links. If a page has no internal links pointing to it — or if it's buried deep in a site with a complex architecture — Googlebot may never find it during a routine crawl, which is why internal linking and a sitemap solve overlapping problems. A sitemap solves this by providing a direct list.

There are four situations where a sitemap delivers the most value:

  1. New sites. A brand-new domain has no backlinks and few internal links. A sitemap gets your pages in front of Google immediately.
  2. Large sites. Sites with thousands of pages (e-commerce, news publishers, content libraries) rely on sitemaps to ensure Googlebot allocates crawl budget to every section — not just the homepage and top-nav pages.
  3. Orphaned or deep pages. Pages with no internal links (orphan pages) or pages buried 5+ clicks from the homepage are at risk of being skipped without a sitemap.
  4. Freshness-sensitive content. News articles, product listings, and blog posts that update frequently can use the lastmod field to signal Google that a re-crawl is warranted.
Google's official position

Google Search Central states: "If your site's pages are properly linked, our web crawlers can usually discover most of your site. Even so, a sitemap can improve the crawling of larger or more complex sites, or more specialised files such as video, images, and news content."

How an XML sitemap works

The workflow has three steps: generation, hosting, and submission.

1. Generation

Your sitemap is generated either by your CMS (WordPress with Yoast or RankMath, Shopify, Wix), your static site generator (Astro, Next.js, Jekyll), or a dedicated sitemap tool. The output is an XML file containing every URL you want indexed.

2. Hosting

The sitemap file is placed on your web server — most commonly at https://yourdomain.com/sitemap.xml. You should also reference it inside your robots.txt file:

User-agent: *
Disallow:

Sitemap: https://example.com/sitemap.xml

3. Submission

Submit the sitemap URL directly in Google Search Console under Indexing > Sitemaps. This gives you a dashboard showing how many URLs were submitted vs. how many were indexed — a critical metric for diagnosing crawl coverage problems.

Types of sitemaps

The Sitemaps protocol supports several specialised formats beyond the standard URL sitemap.

TypePurposeKey extension namespace
Standard URL sitemap List all crawlable pages sitemaps.org/sitemap/0.9
Image sitemapDeclare images for Google Imagesgoogle.com/schemas/sitemap-image
Video sitemapDeclare video metadata for Video Searchgoogle.com/schemas/sitemap-video
News sitemapSubmit articles to Google Newsgoogle.com/schemas/sitemap-news
Sitemap indexReference multiple child sitemapssitemaps.org/sitemap/0.9 (index)

For most marketing sites and SaaS products, a standard URL sitemap is sufficient. Large e-commerce stores often add an image sitemap to maximise Google Images visibility for product photography.

Sitemap index files

A single XML sitemap is capped at 50,000 URLs and 50 MB. Once your site exceeds either limit, you need a sitemap index — a master file that references multiple child sitemaps.

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemap-blog.xml</loc>
    <lastmod>2026-06-01</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://example.com/sitemap-products.xml</loc>
    <lastmod>2026-06-01</lastmod>
  </sitemap>
</sitemapindex>

Submit the index file URL to Search Console — Google will automatically crawl all child sitemaps referenced within it.

What to include (and exclude) in your sitemap

Every URL in your sitemap should be a page you actively want indexed. That sounds obvious, but many sites accidentally list URLs they've blocked in robots.txt or tagged as noindex.

Include

  • All canonical, indexable pages — blog posts, product pages, landing pages, category pages
  • The canonical version of URLs (e.g. https with trailing slash, not http without)
  • Pages that are important but have few internal links

Exclude

  • Pages blocked in robots.txt
  • Pages with a noindex meta tag
  • Duplicate or near-duplicate pages (pagination variants, filter URLs, session IDs)
  • Thin or low-quality pages you wouldn't want ranking
  • Redirect URLs — only include the final destination
Common mistake — listing noindex pages

If a URL appears in your sitemap but has a noindex meta tag, you are sending Google contradictory signals. Google will usually respect the noindex, but the conflict wastes crawl budget and muddies your indexing reports in Search Console. Always audit your sitemap against your noindex list.

Best practices for XML sitemaps in 2026

  1. Keep it dynamic. Auto-generate your sitemap from your CMS or site framework so new pages appear within hours of being published — not days.
  2. Use accurate lastmod dates. Only update lastmod when the page content meaningfully changes. Faking lastmod to get more frequent crawls backfires — Google learns to ignore artificially updated dates.
  3. Split large sitemaps logically. Segment by content type (blog, products, categories) so you can analyse crawl coverage per segment in Search Console.
  4. Reference it in robots.txt. Many crawlers discover sitemaps via robots.txt, not via Search Console submission. The robots.txt reference ensures Bing and other engines find it too.
  5. Monitor submission vs. indexed gap. If Search Console shows 500 URLs submitted but only 300 indexed, investigate why 200 aren't being indexed — quality issues, canonical problems, or crawl budget constraints.
  6. Compress large sitemaps. Gzip-compress sitemap files over 1 MB to reduce server load and speed up Googlebot downloads.
  7. Test before submitting. Use Google's URL Inspection tool or the Rich Results Test to validate your sitemap XML is well-formed before submitting to Search Console.

Common XML sitemap mistakes to avoid

  • Including redirect URLs. Every URL in the sitemap should return a 200 OK. Links to redirected URLs waste crawl budget and dilute signals.
  • Outdated sitemaps. A sitemap that doesn't reflect deleted pages leads Google to crawl dead URLs repeatedly, eating into your crawl budget.
  • Setting all priorities to 1.0. If every page has priority 1.0, the signal is meaningless. Google ignores uniform priority values.
  • Not submitting to Search Console. Listing the sitemap in robots.txt is not enough — Search Console submission gives you indexing analytics you can't get any other way.
  • Forgetting image and video sitemaps. If your site relies heavily on visual content, the standard URL sitemap alone won't ensure that content appears in Google Images or Video Search.

Frequently asked questions

Sitemaps do not directly boost rankings. They improve crawl coverage — ensuring Google discovers and indexes all your pages. More indexed pages means more chances to rank, but the sitemap itself is not a ranking signal.

Update your sitemap whenever you publish, update, or delete pages. Most CMS platforms and sitemap plugins handle this automatically. For large sites, regenerate and resubmit at least once a week.

A single XML sitemap file can hold up to 50,000 URLs and must be no larger than 50 MB (uncompressed). Larger sites should split into multiple sitemap files and reference them from a sitemap index file.

No. Only include URLs you want indexed. Listing noindex pages in your sitemap sends conflicting signals to Google — the sitemap says 'crawl this' while the meta tag says 'don't index it'.

Place your sitemap at the root of your domain — ideally at /sitemap.xml. Reference it in your robots.txt with 'Sitemap: https://yourdomain.com/sitemap.xml' and submit it directly via Google Search Console.

Sources

Akshay VR

Akshay VR

Marketing Head · theStacc · ex-Sr Marketing Specialist, ARKA 360 · Malappuram, Kerala

Akshay leads editorial and content operations at theStacc. He writes about SEO craft, content operations, and the small decisions that compound into ranking wins — including making sure every page you publish actually gets crawled and indexed.