What is an XML sitemap?
An XML sitemap is a file that lists the pages on your site you want search engines to find, usually at /sitemap.xml. Each entry gives a page's full address in loc and, optionally, when it last changed in lastmod:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.co.uk/boiler-repair</loc>
<lastmod>2026-09-01</lastmod>
</url>
</urlset>Large sites split theirs into several sitemaps and list them in a sitemap index. A sitemap helps Google find your pages; it doesn't guarantee they will be crawled or indexed.
Do you need one? Google says you may not if your site has about 500 pages or fewer and every important page is linked from others. New sites with few links pointing to them, and large sites, gain the most. Most website platforms create one automatically, so it usually costs nothing to have.
Where to find your sitemap
- WordPress without an SEO plugin:
/wp-sitemap.xml - WordPress with Yoast SEO or Rank Math:
/sitemap_index.xml - Shopify, Wix and Squarespace:
/sitemap.xml - Anywhere: look for a
Sitemap:line in your robots.txt. The robots.txt checker lists it.
Common sitemap problems and how to fix them
- Pages that shouldn't be there. Redirects, 404s, noindex pages and duplicates. A sitemap should list only the main, indexable version of each page. It's usually a plugin setting, or pages left behind after a redesign.
- Mixed versions of your address.
http://andhttps://, or www and non-www, in the same sitemap. Every URL should use the one version your site redirects to. - Relative addresses.
<loc>/services</loc>won't do. Google asks for full, absolute URLs. - Too big. One sitemap can hold 50,000 URLs or 50 MB uncompressed. Past that, split it and list the parts in a sitemap index.
- A lastmod that's always today. Some setups stamp every page with the current date. Google uses lastmod only when it's consistently accurate, so a date that always changes teaches Google to ignore it.
Source: Google's guide to building a sitemap.