An XML sitemap is the list of URLs you want search engines to know about. Most CMSs generate one automatically, but generated sitemaps often include redirects, noindexed pages and duplicates, which makes them less useful as a signal. This guide covers what a clean sitemap contains, the hard limits, how lastmod really gets used, and how to submit and debug sitemaps in Google Search Console and Bing Webmaster Tools.
Key takeaways
- An XML sitemap should list only indexable, canonical URLs that return 200, leaving out redirects, noindexed pages and duplicates.
- Each sitemap file can hold up to 50,000 URLs or 50MB uncompressed, so split larger sitemaps using a sitemap index.
- Google and Bing ignore priority and changefreq, but Google uses lastmod to schedule recrawls when it is consistently accurate.
- Never set every lastmod to the time the sitemap was generated, because a wrong lastmod is worse than none.
What a sitemap does
A sitemap helps search engines discover URLs and decide when to recrawl them. It doesn't force indexing. Google calls a submitted sitemap a hint, not a guarantee. Sitemaps help most when:
- The site is new and has few external links.
- The site is large, and some pages sit many clicks from the homepage.
- Content changes often, like news, listings or inventory.
- Pages aren't well linked internally. You should fix that too (see our internal linking strategy).
On a small, well-linked site, Google would find everything anyway. The sitemap still gives you useful reporting in Search Console.
The minimum valid sitemap
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2026-09-28</lastmod>
</url>
<url>
<loc>https://www.example.com/services/web-design</loc>
<lastmod>2026-08-14T09:30:00+00:00</lastmod>
</url>
</urlset>
Requirements:
- UTF-8 encoding. Characters like
&must be entity-escaped (&). - Absolute URLs, with the same protocol and host you use everywhere else. If the site lives on
https://www., every<loc>should start withhttps://www.. - Only
<loc>is required.
Limits
| Limit | Value |
|---|---|
| URLs per sitemap file | 50,000 |
| File size per sitemap | 50MB uncompressed (gzip is allowed) |
| Sitemaps per sitemap index | 50,000 |
| Sitemap index files per site in Search Console | 500 |
If you go over either per-file limit, split the sitemap and list the pieces in a sitemap index:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.example.com/sitemap-pages.xml</loc>
<lastmod>2026-10-01</lastmod>
</sitemap>
<sitemap>
<loc>https://www.example.com/sitemap-products-1.xml.gz</loc>
<lastmod>2026-10-11</lastmod>
</sitemap>
</sitemapindex>
A sitemap index can't list other index files. Child sitemaps must be on the same host, in the same directory as the index or below it, unless you've set up cross-site submission.
You don't need to wait for the limits to split. Separate sitemaps for pages, posts, products and categories show up as separate rows in Search Console, which makes indexing problems far easier to isolate.
What to include and what to leave out
A sitemap should list only indexable, canonical URLs that return 200. Every URL is effectively a claim that says "this is a page I want in search results."
Include:
- Canonical versions of pages you want ranked
- Self-canonical pages that return 200
- Important pages that are deep in the site
Exclude:
- URLs that redirect (3xx). List the final destination instead.
- 404 and 410 URLs
- Pages with
noindex - Non-canonical duplicates, like parameter URLs, print views,
?ref=tracking URLs, or thehttp://and non-www versions - Pages blocked by robots.txt
- Thin utility pages: cart, login, thank-you pages, internal search results
When a sitemap lists URLs that redirect, are noindexed or point their canonical elsewhere, you're sending Google conflicting signals. Google also uses sitemap inclusion as one of several canonicalization hints, so listing the wrong variant weakens your canonical tags.
lastmod: the one optional tag that matters
Both Google and Bing ignore <priority> and <changefreq>. You can leave them out.
<lastmod> is different. In its 2023 announcement retiring the sitemap ping endpoint, Google said it uses lastmod to schedule recrawls of known URLs, but only when the value is consistently and verifiably accurate. Bing has said much the same, and calls lastmod a key signal for recrawling.
Rules for useful lastmod values:
- Use W3C Datetime format:
2026-10-11or2026-10-11T14:05:00+00:00. Bing recommends including the time. - Update it only for significant changes, like the main content, structured data or important links. A new copyright year in the footer or a sidebar widget doesn't count.
- Never set every URL to the time the sitemap was generated. Search engines learn the value is meaningless and stop trusting it for your site.
If your plugin stamps every URL with "now", fix it or turn lastmod off. A wrong lastmod is worse than none.
Specialized sitemaps
Google supports extensions to the standard format:
- Image sitemaps for images Google might not otherwise find, such as those loaded by JavaScript
- Video sitemaps with title, thumbnail and duration
- News sitemaps for articles published in roughly the last two days, for Google News publishers
- hreflang annotations using
xhtml:linkfor multilingual sites
Most small-business sites don't need any of these. A clean standard sitemap is enough.
Where sitemaps come from
| Platform | Default location |
|---|---|
| WordPress core (5.5+) | /wp-sitemap.xml |
| Yoast SEO / Rank Math | /sitemap_index.xml |
| Shopify | /sitemap.xml |
| Wix / Squarespace | /sitemap.xml |
If you run an SEO plugin on WordPress, make sure only one sitemap is active. Yoast and Rank Math turn off the core sitemap automatically. Custom setups sometimes end up with both.
Submitting your sitemap
1. Reference it in robots.txt
This works for every crawler that supports the Sitemap field, including Google and Bing:
Sitemap: https://www.example.com/sitemap_index.xml
The URL must be absolute. You can list more than one. More in our robots.txt guide.
2. Google Search Console
- Open your property and go to Indexing > Sitemaps. You need owner permission.
- Enter the sitemap URL under Add a new sitemap and click Submit.
- Check the status:
- Success: fetched and parsed. URLs are queued for crawling.
- Has errors: parsed, with some problems. Valid URLs are still used.
- Couldn't fetch: Google couldn't download the file. Common causes are a 404, a robots.txt block, server errors or a firewall.
After a fetch failure, Google retries for a few days and then stops. Once you've fixed the cause, resubmit. For a sitemap that's working, you don't need to resubmit after every change, because Google rereads it on its own schedule.
Google retired its anonymous ping?sitemap= endpoint. Requests to it now return a 404. If old code or a plugin still pings it, the request does nothing.
3. Bing Webmaster Tools
- Verify the site. You can import it straight from Google Search Console.
- Go to Sitemaps and click Submit sitemap.
- Bing fetches it right away, then usually rereads it at least once a day. Check the Last read date and the status column.
For changes that need to be picked up quickly, Bing recommends IndexNow alongside sitemaps. It's a protocol that pushes added, updated or deleted URLs to participating search engines as soon as they change. Many CMS plugins and CDNs support it.
Debugging a sitemap
Look at the Page indexing report in Search Console and filter by sitemap (the dropdown at the top). This compares the URLs you submitted with the URLs Google actually indexed. Large numbers of "Page with redirect", "Excluded by 'noindex' tag" or "Alternate page with proper canonical tag" for submitted URLs mean your sitemap needs cleaning. For "Crawled – currently not indexed," see our guide to that status.
Frequently asked questions
Does every website need an XML sitemap?
Not strictly. Small sites with good internal links get crawled fine without one. A sitemap costs nothing to keep, though, and it lets you see indexing coverage for exactly the URLs you care about.
Should I include images or PDFs in my sitemap?
Only if you want them indexed. PDFs can go in a standard sitemap as ordinary <loc> entries. Images go in an image sitemap extension or as image:image entries under each page URL.
How often should I update my sitemap?
Whenever URLs are added, removed or significantly changed. A CMS plugin should handle this automatically. You don't need to resubmit a working sitemap in Search Console, because Google refetches it on its own.
Why does Search Console say "Sitemap could not be read"?
Usually it's because the URL returns HTML instead of XML (a login wall or an error page), the file is blocked by robots.txt or a firewall, or the XML is invalid because of an unescaped &. Open the sitemap URL in a private window and run it through an XML validator.
What to do next
Open your sitemap and spot-check 20 URLs. Each one should return 200, have no noindex, point its canonical at itself, and use your preferred host. Check that lastmod values vary and look believable. Then run a free audit to confirm your sitemap is found and referenced from robots.txt. On paid plans, the whole-site crawl compares your sitemap with the pages it actually finds, so you can spot orphan pages and sitemap entries that shouldn't be there.
Sources
- Google Search Central: Build and submit a sitemap
- Google Search Central: Manage your sitemaps with sitemap index files
- Google Search Central Blog: Sitemaps ping endpoint is going away
- Search Console Help: Manage sitemaps using the Sitemaps report
- Bing Webmaster Blog: Keeping Content Discoverable with Sitemaps in AI Powered Search
Written by the MakeItFlow team
We build the website audit these guides are based on. Every fact is checked against the primary sources listed above . How we research and check
Check your own site in 30 seconds
Run a free audit covering speed, SEO, DNS, email authentication and security headers — and get a prioritised fix list.