When Google's crawlers visit your website, they follow links to discover your content. But what happens to pages that are not well-linked internally, buried deep in your site structure, or simply new? Without a sitemap, these pages may take weeks or months to be discovered and indexed — or may never be found at all.
An XML sitemap solves this problem by giving Google a direct map of every page on your site that you want indexed. Think of it as handing Googlebot a complete directory of your site rather than making it find everything by following links.
What Is an XML Sitemap?
An XML sitemap is a file — typically named sitemap.xml — that lists the URLs on your website along with optional metadata about each page: when it was last modified, how frequently it changes, and its relative priority compared to other pages on your site.
A basic XML sitemap looks like this:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://yoursite.com/page/</loc>
<lastmod>2026-03-01</lastmod>
</url>
</urlset>
The loc tag contains the canonical URL of the page. The lastmod tag tells Google when the page was last updated, which helps it prioritise recently changed pages for recrawling.
Why Sitemaps Matter for SEO
Submitting a sitemap does not guarantee that Google will index every URL you list — Google still makes its own decisions about what to crawl and index based on quality signals. But it does guarantee that Google knows every URL exists. Without a sitemap, new pages and pages with few internal links may wait months to be discovered.
Sitemaps are particularly valuable for large sites with thousands of pages, new sites that have not yet built many backlinks, sites with pages that are not well-connected by internal links, and sites that update content frequently. For a small site with strong internal linking, a sitemap matters less — but it costs nothing to have one and there is no downside.
What to Include in Your Sitemap
Your sitemap should only include pages that you want Google to index. Common mistakes include listing pages that should not be indexed — which wastes crawl budget and can cause confusion. Follow these guidelines:
Include: All important public pages — homepage, service pages, product pages, blog posts, landing pages.
Exclude: Pages blocked by robots.txt, pages with a noindex tag, duplicate content pages, thin content pages, admin or login pages, URL parameters that generate duplicate versions of the same page.
Every URL in your sitemap should return a 200 status code. Including redirected or broken URLs in your sitemap sends conflicting signals to Google. Run a broken link scan before finalising your sitemap to ensure all listed URLs are returning clean 200 responses.
How to Create an XML Sitemap
For WordPress sites: The Yoast SEO or Rank Math plugins generate and maintain your sitemap automatically. Once installed, your sitemap is typically available at yourdomain.com/sitemap.xml or yourdomain.com/sitemap_index.xml.
For other platforms: Most CMS platforms including Shopify, Wix, and Squarespace generate sitemaps automatically. Check your platform's documentation for the default sitemap URL.
For custom-built sites: You can generate a sitemap manually for small sites, or use a free online sitemap generator that crawls your site and outputs a valid XML file. For dynamic sites built in PHP, you can write a PHP script that queries your database and outputs the sitemap XML dynamically — ensuring it always reflects your current content.
How to Submit Your Sitemap to Google
Once your sitemap is live, submit it to Google Search Console:
- Log into Google Search Console
- Select your property
- Click Sitemaps in the left sidebar
- Enter your sitemap URL in the field provided (e.g.
sitemap.xml) - Click Submit
Google will process your sitemap and show you how many URLs were submitted and how many were indexed. Check back after a few days to see the status. If Google reports errors, fix them and resubmit.
Sitemap Best Practices
Keep it updated. Every time you publish new content, add it to your sitemap. Dynamic sitemaps that auto-generate from your CMS are ideal because they stay current without manual maintenance.
Use sitemap index files for large sites. A single sitemap file can contain a maximum of 50,000 URLs. Larger sites should use a sitemap index file that references multiple individual sitemaps — one for pages, one for posts, one for products.
Reference your sitemap in robots.txt. Add this line to your robots.txt file: Sitemap: https://yourdomain.com/sitemap.xml. This helps search engines other than Google find your sitemap automatically.
Combine your sitemap submission with a review of your page speed and SSL configuration — a fast, secure site gets crawled more efficiently once Google starts following your sitemap.
Summary
An XML sitemap is one of the simplest and most impactful technical SEO investments you can make. It costs nothing, takes under an hour to set up, and ensures Google knows about every page you want indexed. Create it, submit it to Search Console, keep it updated as you publish new content, and verify regularly that it contains only clean, indexable URLs.
Missed the previous article? Read: Meta Descriptions: Do They Still Matter for SEO?