Search engines find most pages by following links. A sitemap is the second route in: a file you publish that says "here are my pages, and here is when each one changed." For a five-page site with a tidy menu it changes little. For a new site that nobody links to yet, or a store with thousands of products, it can decide how quickly new pages are found.
This guide explains what an XML sitemap is, who needs one, what belongs in it, and how to submit it to Google and Bing. It includes a worked example for an invented bakery and a free check you can run in about 15 minutes. Every statement about Google and Bing comes from their own documentation, checked on November 18, 2026.
A sitemap tells search engines where your pages are. It can't make them want to index a page they don't think is worth it.
What is an XML sitemap?
An XML sitemap is a file, usually at /sitemap.xml, that lists the URLs on a site in a standard format search engines read. Google's sitemap overview describes it as a file where you provide information about the pages, videos and other files on your site, so search engines can crawl it more efficiently.
The format is the Sitemaps protocol, published at sitemaps.org and supported by Google, Bing and other engines. A sitemap is not the same as an HTML sitemap page, which is a list of links written for visitors. Five terms cover most of what you will meet:
| Term | What it means |
|---|---|
<urlset> | The outer element of a sitemap. Required. |
<loc> | The full address of one page. Required for every entry. |
<lastmod> | The date the page last changed in a meaningful way. Optional, but the one optional tag search engines use. |
| Sitemap index | A file that lists other sitemaps instead of pages, for sites that need more than one. |
| Sitemap extensions | Extra tags for images, videos and news articles, which Google documents separately, starting with image sitemaps. |
Do you need an XML sitemap?
You probably benefit from one if your site is large, new, or has pages that aren't linked well from the rest of the site. Google says you might not need one if your site has about 500 pages or fewer and every important page is linked internally.
Google's overview lists the cases in both directions:
- You might need one if the site is large, if it is new and has few external links to it, or if it has a lot of rich media such as video and images, or appears in Google News.
- You might not need one if the site is "small" (Google's word, defined as about 500 pages or fewer), if it is comprehensively linked internally, and if you don't have many media files or news pages you want to show in search.
We add one to every site we work on, small ones included. Most platforms generate it for free, it gives Search Console a list of the pages you consider important, and its lastmod dates help Bing decide what to recrawl, as covered further down. If a small site's pages aren't being found, though, a sitemap rarely fixes the cause: weak internal linking usually does.
No. Google's overview says using a sitemap "doesn't guarantee that all the items in your sitemap will be crawled and indexed," and its build guide calls submitting one "merely a hint." A sitemap affects discovery. Whether a page ranks depends on the page.
What should an XML sitemap include?
An XML sitemap should include only the URLs you want to appear in search results: the canonical version of each page, returning a 200 status, without a noindex tag. Google's guide to building and submitting a sitemap says to "include the URLs in your sitemap that you want to see in Google's search results."
The same guide sets the technical rules:
- Size: one sitemap can hold up to 50,000 URLs or 50 MB uncompressed, whichever comes first. The sitemaps.org protocol allows compressing the file with gzip, as
sitemap.xml.gz, but the limits still apply to the uncompressed size. - Full addresses: use fully qualified, absolute URLs, such as
https://example.com/menu, not/menu. - Encoding: the file must be UTF-8 encoded.
- Location: a sitemap affects only the folder it sits in and the folders below it, unless you submit it through Search Console. Google recommends the site root.
- Canonical URLs: when the same content is reachable at several addresses, list the one you prefer. Sitemap inclusion is one of the signals in our guide to canonical tags.
- Language versions: a site in more than one language can list each page's translations inside its sitemap entry with
xhtml:linkhreflang annotations. Google's guide to localized versions of your pages describes the sitemap as one of three ways to do it. Our own English and French pages use this method.
Which tags do Google and Bing actually use?
Google and Bing use <loc> and an accurate <lastmod>, and both ignore <priority> and <changefreq>. Many plugins still write the last two, so they look important. They aren't.
| Tag | Bing | |
|---|---|---|
<loc> | Required | Required |
<lastmod> | Used if it is "consistently and verifiably" accurate | A "key signal" for deciding what to recrawl |
<changefreq> | Ignored | Ignored |
<priority> | Ignored | Ignored |
Google's column comes from its build guide and a Search Central post of June 26, 2023, Sitemaps ping endpoint is going away, by Gary Illyes, which says Google "still doesn't use the changefreq or priority elements at all." Bing's column comes from its Webmaster blog post of July 31, 2025, quoted in the AI search section below.
"Accurate" has a specific meaning. Google's build guide says lastmod should reflect the last significant update, such as a change to the main text, structured data or links, and that updating a copyright date isn't one. The sitemaps.org protocol adds that the date is when the page changed, "not when the sitemap is generated."
What does an XML sitemap look like?
An XML sitemap is a short header followed by one <url> entry per page, each holding the page's address and, optionally, its last-modified date. Here is the start of one for an invented bakery with a small site.
The first two entries in a small business sitemap
<?xml version="1.0"
encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org
/schemas/sitemap/0.9">
<url>
<loc>https://northfieldbakery
.example/</loc>
<lastmod>2026-11-02</lastmod>
</url>
<url>
<loc>https://northfieldbakery
.example/wedding-cakes</loc>
<lastmod>2026-10-14</lastmod>
</url>
</urlset>
- The declaration. It states the file is XML in UTF-8, the encoding Google requires.
- The namespace. This exact address tells search engines which protocol the file follows.
- A full address. Protocol, host and path, written exactly as in the page's canonical tag.
- An honest date. The day the page's content last changed, in the W3C date format the protocol uses.
- Nothing else. No
priorityorchangefreq, because Google and Bing ignore them.
The harder part is deciding which addresses go in. Here is how the bakery treats eight URLs that its site can serve:
| Address | In the sitemap? | Why |
|---|---|---|
/wedding-cakes | Yes | A canonical page the bakery wants found |
/blog/sourdough-starter, published today | Yes, with today's lastmod | New pages are what a sitemap helps most |
/wedding-cakes?utm_source=instagram | No | A tracking copy whose canonical tag names the clean URL |
http://northfieldbakery.example/wedding-cakes | No | It redirects to the HTTPS address |
/old-menu | No; list /menu | It redirects. List the final address |
/thank-you | No | It carries noindex, so it shouldn't be in search results |
/cart | No | Nobody searches for an empty basket |
/christmas-2025, now removed | No | It returns a 404 error |
Two in, six out. The rule behind every row is Google's: list what you want to see in search results, at the address you want shown.
How do you create an XML sitemap?
You create an XML sitemap by letting your platform generate it, using an SEO plugin, or having your build process write it. Google's build guide recommends letting your CMS do it when you use one, and says to generate the file automatically once it holds more than a few dozen URLs.
- WordPress: WordPress has generated a sitemap since version 5.5, announced on the WordPress core blog in July 2020, at
/wp-sitemap.xml. In the comments under that announcement, its author, Pascal Birchler, notes that Yoast SEO disables it in favor of its own sitemap, so check which one your site uses. - Shopify: Shopify's help center says every store automatically generates a
sitemap.xmlwith links to all products, their primary image, pages, collections and blog posts, at the root of the store's domain. - Other platforms: Google names WordPress, Wix and Blogger as systems that may already have made a sitemap available. Try
/sitemap.xmlon your domain, then search your platform's help pages for "sitemap". - A hand-built or custom site: generate the file in your build or from your database, so it updates whenever pages change. Our own site does this: the build writes each page's
lastmodfrom the date we last changed it meaningfully.
If a site needs more than one sitemap, a sitemap index ties them together. Google's page on sitemap index files says an index can list up to 50,000 sitemaps and that you can submit up to 500 index files per site in Search Console. The sitemaps it lists must be on the same site, in the index file's folder or below it.
How do you submit a sitemap to Google and Bing?
You submit a sitemap by adding a Sitemap: line to robots.txt and entering its address in Google Search Console and Bing Webmaster Tools. Either route works for discovery; Search Console adds a report on what Google found.
- Open the file yourself. Load the sitemap address in a browser and confirm it opens without a login or an error. This step is ours.
- Add it to robots.txt. Google's build guide says the line can go anywhere in the file and must use the full URL, for example
Sitemap: https://example.com/sitemap.xml. You can list several. If you're editing robots.txt for the first time, our guide to robots.txt and AI crawlers explains the rest of the file. - Submit it in Search Console. Open the Sitemaps report, paste the sitemap URL into "Add a new sitemap" and click Submit. Google's Sitemaps report help page says it will try to crawl the sitemap as soon as you submit it, but crawling the URLs listed can take some time.
- Submit it in Bing Webmaster Tools. Bing says it fetches a sitemap immediately on submission and then revisits it regularly, typically at least once a day.
- Don't ping. Google's 2023 post announced that its old sitemap "ping" address would stop working six months later. The post now says the deprecation is complete, so scripts that still ping Google get an error.
For faster notice of changed pages on Bing, there is IndexNow, a protocol that tells participating search engines about a change as soon as it happens. Its site lists Microsoft Bing, Naver, Seznam.cz, Yandex and Yep. Google isn't on that list, so IndexNow supplements a sitemap rather than replacing it.
What do the Sitemaps report statuses mean?
The Sitemaps report in Search Console shows one of three statuses for each submitted sitemap: Success, Has errors or Couldn't fetch. The definitions below are Google's; the actions are ours.
| Status | Google's definition | What to do |
|---|---|---|
| Success | The sitemap was loaded and processed with no errors | Compare its "Discovered pages" count with the number of pages you meant to list |
| Has errors | The sitemap was fetched but has one or more errors | Open the sitemap in the report, fix each error listed, and resubmit |
| Couldn't fetch | The sitemap could not be fetched | Open the exact URL you submitted in a private browser window. Check it isn't blocked by robots.txt or a login, and that it isn't a redirect |
"Discovered pages" is the number of page URLs Google parsed from the file. The help page is clear that this is not a count of indexed pages: there is no guarantee a discovered URL has been or will be crawled or indexed. Indexing is reported separately, in the Page indexing report.
Do XML sitemaps matter for AI search?
XML sitemaps matter for AI search because AI answers from Google and Bing draw on pages those engines have found and indexed, and a sitemap is one of the ways they find them. Bing has said so directly; Google's wording is more general.
Bing's Webmaster blog post of July 31, 2025, Keeping Content Discoverable with Sitemaps in AI Powered Search, says Bing continues full support of the Sitemap protocol and that lastmod "remains a key signal, helping Bing prioritize URLs for recrawling and reindexing." It asks for ISO 8601 dates that include the time, set to when the page really changed, not when the sitemap was generated. It also says no tool can guarantee when or how content appears in AI-generated results.
Google's guide to AI features and your website says a page must be indexed and eligible to be shown in Google Search with a snippet to appear as a supporting link in AI Overviews or AI Mode, and that "there are no additional technical requirements." A sitemap helps with the first step, being found. The rest of the work is covered in our guide to showing up in Google AI Mode.
What are the most common XML sitemap mistakes?
The most common XML sitemap mistakes are listing URLs you don't want indexed, writing dates that aren't true, and leaving the file to go stale. Each one weakens the file as a signal.
| Mistake | Why it matters |
|---|---|
| Redirected, noindex or 404 URLs in the file | Google asks for URLs you want in its results. These aren't, and they send mixed signals about which page you prefer. |
| Non-canonical URLs | A sitemap listing one address while the canonical tag names another contradicts itself. |
Every lastmod set to today | Google uses lastmod only if it is consistently and verifiably accurate. A file that always says "today" teaches it to ignore the dates. |
Relying on priority and changefreq | Google and Bing ignore both, so time spent tuning them is wasted. |
| Relative URLs | Google's build guide asks for fully qualified, absolute URLs. |
| Sitemap in a subfolder | Unless it is submitted in Search Console, it only covers that folder and the ones below it. |
| A file that never updates | New pages are missing and deleted ones linger. Generate it automatically. This row is our advice. |
How do you check your XML sitemap for free?
You check your XML sitemap by opening it, testing a sample of its URLs, and comparing what you listed with what Search Console reports. On a small site this takes about 15 minutes with a browser and Search Console.
- Find it. Open
yourdomain.com/robots.txtand look for aSitemap:line. If there isn't one, try/sitemap.xmland/wp-sitemap.xml. - Count the entries. Search the file for
<loc>and compare the count with the number of pages you want found. A big gap either way needs explaining. - Read the addresses. Each should start with
https://and use the host name your site settled on. - Test five URLs. Open five at random, including the oldest. Each should load directly without a redirect, have no noindex tag, and have a canonical tag naming itself.
- Check the dates. Pick a page you edited recently and one you haven't touched in a year. Their
lastmodvalues should reflect that. - Open the Sitemaps report. Look for Success, and compare "Discovered pages" with your count from step 2.
- Open the Page indexing report. Look for listed pages Google hasn't indexed, and start with the ones that matter most to your business.
We ran the first five steps on our own site. Its robots.txt names https://digitalrelevance.io/sitemap.xml, every address in the file uses HTTPS and the bare domain, every listed page carries a canonical tag naming itself, and the file has no priority or changefreq. Its lastmod values are dates without a time: the sitemaps.org protocol allows that, though Bing's post asks for the time as well. Sitemaps sit with robots.txt, redirects and canonicals in the crawling section of our technical SEO checklist.
The short version: let your platform generate the file, keep only canonical, indexable URLs in it, make every lastmod true, and submit it once in each search engine's tools. Then read the report, because a sitemap tells you what you asked for and the report tells you what happened.
We checked the details in this guide against Google's sitemap documentation, its 2023 Search Central post and AI features guide, Search Console's help center, Bing's July 2025 Webmaster blog post, the sitemaps.org protocol, IndexNow.org, and the WordPress and Shopify pages on November 18, 2026. A sitemap helps search engines find your pages. It doesn't guarantee indexing, a ranking or an AI citation, and no one can promise that it will.
Want your sitemap checked?
Send us your site and we'll show you which listed pages Google hasn't indexed, which ones shouldn't be listed at all, and what we would fix first. Sitemaps are part of the technical work in our SEO services.
Ask for a Sitemap CheckFrequently Asked Questions
Where is my XML sitemap?
Look for a Sitemap line in yourdomain.com/robots.txt first, since that is where most sites announce it. If there isn't one, try /sitemap.xml at the root of the domain. WordPress without an SEO plugin uses /wp-sitemap.xml, and Shopify stores publish /sitemap.xml automatically. Your platform's help pages will confirm the address.
How often should I update my sitemap?
Update it whenever you add, remove or meaningfully change a page, which is why a generated sitemap beats a hand-written one. You don't need to resubmit after each change. Search Console's help says Google periodically recrawls a sitemap it has crawled successfully, and suggests resubmitting only after big changes. Bing says it typically revisits sitemaps at least once a day.
Should I include images in my XML sitemap?
Only if images matter to how people find you and search engines might miss them. Google documents an image sitemap extension for telling it about images on your pages, and Shopify's sitemap already lists each product's primary image. For most service businesses, a standard page sitemap plus normal image tags with alt text is enough.
Why does Search Console say "Couldn't fetch" for my sitemap?
Google tried to download the file and failed. Open the exact URL you submitted in a private browser window. Common causes are a typo in the address, a file behind a login, a robots.txt rule that blocks it, or an address that redirects. Fix the cause, then resubmit the sitemap in the Sitemaps report.
Can a sitemap get a page indexed faster?
It can help a new page get discovered sooner, especially on sites with few links pointing in. It can't make Google index a page. Search Console's help says there is no guarantee that a page discovered in a sitemap will be crawled or indexed. Whether it is indexed depends on the page itself.
What is the difference between an XML sitemap and an HTML sitemap?
An XML sitemap is a machine-readable file for search engines, listing URLs and their last-modified dates in the Sitemaps protocol format. An HTML sitemap is an ordinary web page of links written for visitors. Google accepts XML, RSS, mRSS, Atom 1.0 and plain text sitemaps. An HTML page of links isn't one of those formats.