TL;DR
- List only canonical, indexable URLs that return a 200 status in your sitemap.
- One sitemap file can hold up to 50,000 URLs or 50 MB uncompressed; larger sites use a sitemap index.
- Google ignores the priority and changefreq fields and uses lastmod only when it’s consistently accurate.
- Submit sitemaps in Search Console or list them in robots.txt; Google retired its sitemap ping endpoint in 2023.
An XML sitemap is a machine-readable list of URLs on your site. Most website platforms, including WordPress, generate one automatically, often at /sitemap.xml or /wp-sitemap.xml.
What belongs in it
Include pages you want to appear in search results:
- the canonical version of each page (see canonical tags);
- pages that return a 200 OK status.
Leave out:
- redirected URLs and 404 pages;
- pages with a noindex rule;
- duplicates, such as filtered or sorted versions of a list;
- URLs blocked in robots.txt.
A sitemap full of redirects and noindexed pages sends mixed signals and makes Search Console reports harder to read.
Format rules
| Rule | Limit or behavior |
|---|---|
| URLs per sitemap file | 50,000 |
| File size | 50 MB uncompressed |
| More than that | Split into several files and list them in a sitemap index |
lastmod |
Used by Google when it’s consistently accurate; update it only when content meaningfully changes |
priority and changefreq |
Ignored by Google |
| URLs | Absolute URLs, matching the protocol and host you use (https, with or without www) |
How to submit it
- Search Console: open Sitemaps, enter the sitemap URL and submit. Search Console then shows when Google last read it and how many URLs it found.
- robots.txt: add a line such as
Sitemap: https://www.example.com/sitemap.xml. Any search engine that reads robots.txt can find it. - Bing Webmaster Tools: submit the same file for Bing.
Note: Google retired its sitemap “ping” URL; in June 2023 it announced the endpoint would stop working about six months later. If an old plugin or script still pings Google, it does nothing useful, so rely on Search Console, robots.txt and accurate lastmod dates instead.
Using it to spot problems
In the page indexing report, filter by “All submitted pages.” Pages in your sitemap that aren’t indexed are the ones to look at first, since you’ve told Google they matter.
FAQ
Does a small site need a sitemap?
Not strictly. A small site with good internal links can be crawled without one. A sitemap still helps you monitor indexing in Search Console and costs nothing if your CMS creates it automatically.
Should images and videos go in my sitemap?
They can. Image and video sitemap extensions help Google find media it might not discover otherwise, which mostly matters for media-heavy sites.
My CMS makes several sitemaps. Is that a problem?
No. Many platforms split sitemaps by content type and link them from an index file. Submit the index file and Google will read the rest.
Search engines update their systems and documentation often. This guide reflects Google’s published guidance at the time of writing; check Google Search Central for current details, and test changes on a staging copy of your site before making them live.
