An XML sitemap is a file that lists the pages on your website you want search engines to find, crawl and index. It won't push you up the rankings by itself. What it does is take the guesswork out of discovery: instead of hoping Google and Bing stumble onto every important page through links, you hand them a clean, current list.
That sounds like a small thing, and on a healthy site it is. The trouble is how often it isn't healthy. When we audit websites for businesses across Vaughan, Toronto and the GTA, the sitemap is one of the first files we open, and it regularly lists redirects, deleted pages, thank-you pages and leftover test content, all presented to Google as the best the site has to offer.
This guide covers what an XML sitemap actually contains, whether your site needs one, how to set it up and submit it in seven steps, and how to read the reports that tell you if it's working. Where it helps, we use our own site as the worked example.
Table of Contents
What Is an XML Sitemap?
An XML sitemap is a machine-readable list of the URLs you want to appear in search results, written in Extensible Markup Language so crawlers can process it quickly. It normally sits at the root of your domain, at an address such as yourdomain.com/sitemap.xml or yourdomain.com/sitemap_index.xml.
A better comparison than a "map" is a shipping manifest. A crawler can still explore your site by following links; the manifest simply confirms what's supposed to be there and, when the dates are honest, which items changed recently. It's a strong hint, not a command. Google's own sitemap documentation describes submitting a sitemap in exactly those terms: a hint that doesn't guarantee crawling or indexing.
Don't confuse it with an HTML sitemap, which is a regular web page of links written for human visitors. The XML version is built for bots, and most of your customers will never see it.
Sitemap index files
Larger websites split their URLs across several files and tie them together with a sitemap index, which is simply a sitemap of sitemaps. According to Google Search Central's sitemap documentation (last updated July 2026), each individual file is capped at 50,000 URLs or 50MB uncompressed, so splitting becomes mandatory past that point.
Most plugins split well before the limit so each file loads quickly. Our own index at socialknowhow.com/sitemap_index.xml points to three child files: one for blog posts, one for pages and one for our local business details. Rank Math builds and updates all three every time we publish or edit something, so nobody on our team touches them by hand.

What's Inside an XML Sitemap (and the Tags Google Ignores)
Here's a stripped-down XML sitemap with two entries:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.ca/services/</loc>
<lastmod>2026-10-28</lastmod>
</url>
<url>
<loc>https://www.example.ca/blog/xml-sitemap/</loc>
<lastmod>2026-11-09</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Four tags show up in most sitemaps. Only two of them do real work for Google:
- <loc> is the page's full, absolute URL. It's the only required tag, and it should be the canonical version of the page: https, the correct domain and a consistent trailing slash.
- <lastmod> is the date the page last changed in a meaningful way. Google uses it, but only when it's consistently and verifiably accurate.
- <changefreq> suggests how often a page changes. Google ignores it.
- <priority> rates a page's importance against the rest of your site on a scale of 0.0 to 1.0. Google ignores this one too.
That last point is worth repeating, because plenty of older SEO advice still tells people to fine-tune priority values. Google's documentation states plainly that it disregards both priority and changefreq, so time spent adjusting them is time wasted.
The tag that deserves your attention is lastmod. In a June 2023 Search Central blog post, Google explained that it uses lastmod to decide when to recrawl pages, and that a "significant" change means an edit to the main content, structured data or links. Updating the copyright year in your footer doesn't count. The same post warned that if your dates claim changes that never happened, Google will eventually stop believing them.
An XML sitemap can also carry extensions for images, videos, news articles and alternate language versions of a page. For most service businesses, image entries are the only extension worth switching on.
Does Your Website Actually Need an XML Sitemap?
Short answer: yes, almost certainly, because on modern platforms it costs you nothing. A small site with strong internal linking can technically get indexed without one, but there's no upside to leaving it out and several situations where it makes a noticeable difference.
An XML sitemap pulls its weight when:
- Your site is new and has few backlinks, so crawlers have fewer paths in.
- You publish often, such as a blog, news section or job listings, and want new URLs picked up quickly.
- You have hundreds or thousands of pages, which is common for ecommerce catalogues and multi-location businesses.
- Some pages are poorly linked, like a landing page built for an ad campaign that should still be indexed.
- You've just migrated or redesigned, and Google needs to learn your new URLs fast.
- Images or video are central to how customers find you.
For most of the small and mid-sized businesses we work with, the real question isn't whether to have one. It's whether the one they already have is telling the truth.
How to Create and Submit an XML Sitemap in 7 Steps
These steps work on any platform. Because many of our clients run WordPress, we go a little deeper on that setup.
Step 1: Check whether you already have an XML sitemap
Before you build anything, look for what already exists. Type these after your domain in a browser: /sitemap.xml, /sitemap_index.xml and /wp-sitemap.xml. Then open yourdomain.com/robots.txt and look for a line starting with "Sitemap:".
There's a good chance something is already there. WordPress has generated a basic sitemap at /wp-sitemap.xml since version 5.5, and SEO plugins such as Rank Math and Yoast replace it with their own. Shopify, Wix and Squarespace generate one automatically too.
The problem we run into most is duplication: an old sitemap plugin still active alongside a newer SEO plugin, so two different files describe the same site. Pick one generator, deactivate the other, and submit only the survivor.
Step 2: Decide what belongs in your XML sitemap
The rule is simple. If you wouldn't want a page to appear as a search result, it doesn't belong in your XML sitemap.
Include pages that are:
- Indexable, with no noindex tag
- Returning a 200 status code, not a redirect or an error
- The canonical version, not a duplicate or a URL with tracking parameters
- Genuinely useful to someone arriving from a search
Leave out:
- Thank-you, confirmation and "form submitted" pages
- Cart, checkout, account and login pages
- Internal search results
- Thin tag and author archives
- Staging, test and "copy of" pages
- Anything you've redirected or deleted
Rank Math automatically drops posts and pages set to noindex, which clears out a lot of this noise. It won't stop you from publishing a weak page and leaving it indexable, though, so the judgment call is still yours.
Step 3: Generate your XML sitemap
On WordPress with Rank Math, the sitemap is a module. Go to Rank Math SEO, then Dashboard, then Modules, and make sure Sitemap is switched on. Then open Rank Math SEO's Sitemap Settings to control what's included:
- General: set how many links go in each file and whether to include images and featured images.
- Excluded posts and terms: add the IDs of individual pages or categories you want left out.
- Post types and taxonomies: include posts and pages, and exclude anything that doesn't deserve to rank, such as thin tag archives.
- Authors: on a site with one or two writers, author archives rarely add value, so leave them out.
Yoast SEO users will find the equivalent switch in the plugin's site features settings. The menus differ, but the thinking is the same.
Shopify, Wix and Squarespace create and update the file for you, with limited editing. You control what's in them mostly by hiding pages from search in each platform's page settings. For a custom-built site, ask your developer to generate the sitemap from the site's database so it updates on its own. A desktop crawler can produce a one-off file for a small static site, but a static file goes stale the moment you publish something new.

Step 4: Validate your XML sitemap before you submit it
Open the file in your browser and read it like an editor, not a developer. Three quick checks catch most problems:
- Count. Does the number of URLs roughly match the number of pages you actually want indexed? Our post sitemap currently lists 41 entries. If that figure ever drifted far from our published post count, we'd know something was being added or dropped.
- Format. Every URL should be absolute, on https, on one version of your domain (with or without www, never both) and follow a single trailing-slash convention.
- Health. Crawl the URLs in the file with an SEO crawler and confirm each one returns a 200 status, isn't blocked by robots.txt and has a canonical tag pointing to itself.
Any URL that fails those checks wastes crawl attention and muddies the signal you're sending.
Step 5: Reference your XML sitemap in robots.txt
Add one line to your robots.txt file pointing to the sitemap's location. Google picks it up the next time it reads that file, and so do other search engines. Here's the line from our own robots.txt:
Sitemap: https://www.example.ca/sitemap_index.xml
Rank Math adds this line for you. On other setups, you can list several sitemaps the same way, one per line, and there's no cap on how many you include.
Step 6: Submit your XML sitemap to Google and Bing
For Google, open Search Console, choose your property, go to Indexing, then Sitemaps, paste the sitemap URL into "Add a new sitemap" and click Submit. If you use a sitemap index, submit the index; Google finds the child files on its own.
One update for anyone following older tutorials: Google retired its sitemap "ping" URL in 2023, and requests to it now return a 404 error. Plugins that still ping won't cause harm, but they won't help either. Search Console, robots.txt and the Search Console API are the supported routes.
For Bing, sign in to Bing Webmaster Tools and submit the same URL under Sitemaps, or import your verified properties straight from Search Console. It's worth the five minutes, because Bing's index reaches beyond Bing.com, including Microsoft Copilot.
If you're on Rank Math, consider switching on its Instant Indexing module too. It uses the IndexNow protocol to notify Bing and other participating engines the moment you publish or update a URL, rather than waiting for the next crawl.

Step 7: Monitor the reports every month
Submitting is where most people stop, and it's where the useful work starts. Two reports in Search Console tell you whether your XML sitemap is doing its job.
The Sitemaps report shows whether Google could read the file. "Success" means it was processed. "Couldn't fetch" or "Has errors" means something is blocking or breaking it; the error table below covers the usual causes.
The Page indexing report is where the real insight lives. Filter it to show only URLs from your submitted sitemaps, then compare submitted pages against indexed pages. The gap tells you what Google chose not to index and why. Typical reasons include:
- Crawled, currently not indexed: Google saw the page and passed. This is usually a content quality or duplication signal, not a technical fault.
- Discovered, currently not indexed: Google knows the URL exists but hasn't crawled it yet, which is common on newer or larger sites.
- Excluded by noindex tag: your sitemap and your page are contradicting each other. Fix one of them.
- Page with redirect or Not found (404): the sitemap is listing URLs that no longer exist as live pages.
We review these numbers monthly alongside analytics. If you're already tracking leads, our guide to Google Analytics 4 for small business covers which reports deserve the same monthly attention.
6 XML Sitemap Errors We See Most Often
Most XML sitemap problems fall into a handful of patterns. Here's what each one usually means and how to fix it.

| Error | What it usually means | How to fix it |
|---|---|---|
| Couldn't fetch | Google can't reach the file because of a wrong URL, a server error, or a block in robots.txt or a firewall | Open the URL in a private browser window, confirm it loads, check robots.txt and security plugin rules, then resubmit |
| Sitemap is HTML | The URL returns a web page, often a 404 template or a cached page, instead of XML | Clear your page cache, exclude sitemap URLs from caching and confirm the sitemap module is active |
| Pages excluded by noindex | The sitemap includes pages you've told Google not to index | Remove the page from the sitemap, or remove the noindex tag if the page should rank |
| Redirects in the sitemap | Old URLs are still listed after a redesign or slug change | List only the final destination URL, then regenerate the sitemap |
| Mixed domains or protocols | Some URLs use http or www while the site lives on https without www, or the reverse | Fix the site address in your CMS settings so every generated URL matches the canonical domain |
| Every lastmod date is identical | The CMS stamped the same date on every URL, usually after a bulk update or migration | Let lastmod reflect real content edits only, so Google keeps trusting the dates |
If the same error keeps returning after you fix it, the cause is usually upstream: a caching rule, a security plugin or a second sitemap generator you forgot was installed.
Why Your XML Sitemap Matters for AI Search Too
Google's AI Overviews draw on Google's index, and several AI assistants pull live results from traditional search engines when they answer a question. A page that never makes it into those indexes has very little chance of being cited.
An XML sitemap won't make your content citable on its own. That depends on clear answers, real expertise and signals of trust. What it does is make sure the pages you've invested in are discoverable in the first place, which is the floor every AI visibility strategy stands on.
If you want to go further, our guide to generative engine optimization explains how businesses earn citations in ChatGPT, Perplexity and AI Overviews, and our AI SEO services page covers how we handle it for clients.
Quick XML Sitemap Checklist
Bookmark this and run through it whenever you launch, redesign or migrate a site:
- One sitemap generator is active, not two.
- The sitemap or sitemap index lives at the root of your domain.
- Every listed URL is indexable, canonical and returns a 200 status.
- Thank-you pages, carts, logins and thin archives are excluded.
- Lastmod dates change only when content meaningfully changes.
- Robots.txt includes a Sitemap line.
- The sitemap is submitted in Google Search Console and Bing Webmaster Tools.
- The Page indexing report gets a monthly review.
XML Sitemap FAQ
Does an XML sitemap improve rankings?
Not directly. It helps search engines discover and recrawl your pages, which is a prerequisite for ranking. Where those pages rank still comes down to content quality, relevance, links and user experience.
How often should I update my XML sitemap?
It should update itself whenever you publish, edit or delete a page. Rank Math, Yoast, Shopify, Wix and Squarespace all handle this automatically. You don't need to resubmit it in Search Console after every change, because Google rechecks submitted sitemaps on its own.
Where should my XML sitemap be located?
At the root of your domain, such as yourdomain.com/sitemap_index.xml. Google notes that unless you submit it through Search Console, a sitemap only covers URLs in the folder where it's stored, so the root covers everything.
What's the difference between an XML sitemap and an HTML sitemap?
An XML sitemap is a structured file written for search engine crawlers. An HTML sitemap is a regular page of links written for people. You can have both, but the XML version is the one that matters for indexing.
How many URLs can one XML sitemap hold?
Up to 50,000 URLs or 50MB uncompressed per file. Past that, split your URLs across multiple files and connect them with a sitemap index.
Should I include images in my XML sitemap?
If images help customers find you, yes. Product photos, portfolio work and project galleries are good candidates. Rank Math can attach the images from each post to that post's sitemap entry automatically.
The Bottom Line
An XML sitemap is one of the few SEO tasks that takes minutes to set up and then works quietly in the background. Set it up once, keep it honest, and check the Page indexing report every month. That last habit is where you'll spot problems before they cost you traffic.
If you'd rather have someone look under the hood, sitemap and indexing health is one of the first things we check when we take on a website project. Book a discovery call and we'll tell you what's working, what's quietly broken and what to fix first.
