Quick answer: A sitemap lists the pages you want search engines to find. Include only pages that load (status 200), are not redirected, are not noindex, and are the main (canonical) version. One file can hold 50,000 URLs or 50 MB uncompressed. Add the sitemap to robots.txt and submit it in Google Search Console.
Do you need one?
Small, well-linked sites get found without one. A sitemap still helps new sites, large sites, and pages with few internal links. It costs nothing, and WordPress makes one for you.
Where WordPress puts it
- WordPress makes
/wp-sitemap.xmlautomatically. - SEO plugins replace it with their own, often
/sitemap_index.xml. - If “Discourage search engines” is ticked in Settings → Reading, WordPress turns the sitemap off.
What to include, and what to leave out
- Include: pages and posts you want in search, with their final https:// address.
- Leave out: redirected URLs, 404 pages, noindex pages, URLs blocked by robots.txt, thin tag and archive pages, and URLs with tracking parameters.
Fields Google uses and ignores
<loc>: required. The full page address.<lastmod>: used if it is accurate. Update it only when the page really changes.<priority>and<changefreq>: Google ignores them.
Limits
- 50,000 URLs per sitemap file
- 50 MB per file, measured uncompressed
- Bigger sites split the list and use a sitemap index that points to each file.
- A sitemap should only list URLs on its own host.
blog.example.comneeds its own sitemap.
Tell search engines where it is
Add one line to robots.txt, then submit the same address in Google Search Console and Bing Webmaster Tools:
Sitemap: https://example.com/wp-sitemap.xml
Google retired its old “sitemap ping” address in 2023, so robots.txt and Search Console are the ways to go.
Common errors and fixes
- “Couldn’t fetch”: the sitemap returns an error or is blocked. Open it in a browser and check the status code.
- URLs that redirect: your sitemap still lists http:// or old addresses. Regenerate it or fix the site address setting.
- 404s in the sitemap: deleted pages are still listed. Most plugins remove them automatically. Clear the cache if not.
- Noindex pages listed: remove them from the sitemap, or remove the noindex.
Check it with our free tools: Sitemap Validator · Robots.txt Generator and Tester · Redirect Checker