What is an XML sitemap?
An XML sitemap is a file, written in the format defined at sitemaps.org, that lists the URLs on your site you want search engines to discover. It is a discovery aid: it helps crawlers find pages, especially new ones and ones with few internal links, but it does not force anything into the index. Google decides per URL whether a page is worth indexing.
Sitemaps matter most for large sites, new sites with few backlinks, and sites that publish often. A small, well-linked site gets found without one, but a sitemap still costs nothing and gives you a reporting surface in Search Console.
How it works
Each sitemap file can hold up to 50,000 URLs or 50 MB uncompressed. Larger sites use a sitemap index: a small file that lists child sitemaps, often one per content type. You tell search engines about it by submitting it in Search Console and Bing Webmaster Tools, and by adding a Sitemap: line to robots.txt.
Each entry needs a <loc>. The optional <lastmod> is the useful one: Google uses it when it is consistently accurate. Google ignores <priority> and <changefreq>, so there is no benefit in tuning them. Extensions exist for images, video, and Google News.
Example
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/pour-over-guide/</loc>
<lastmod>2026-09-12</lastmod>
</url>
<url>
<loc>https://example.com/grinder-reviews/</loc>
<lastmod>2026-08-30</lastmod>
</url>
</urlset>
Every <loc> should be the canonical, indexable, 200-status version of the page.
In WordPress
WordPress core has generated a basic sitemap at /wp-sitemap.xml since version 5.5. SEO plugins usually replace it with their own. Hydrogen SEO builds a sitemap index with per-post-type and per-taxonomy sitemaps, image entries, lastmod dates in UTC, and automatic exclusion of noindexed and password-protected content; see XML sitemaps. After that, submit it to Google. The sitemap best practices post goes deeper.
Common mistakes
- Listing URLs that redirect, 404, or carry noindex. It wastes crawls and weakens trust in the file.
- Setting every
lastmodto today on each build. Google stops trusting dates that are always new. - Two plugins generating two sitemaps, with different URL sets.
- Reading "Success" in Search Console as "indexed". It only means the file was parsed; check the Pages report for indexing.
Common questions
Does a sitemap improve rankings?
No. It helps search engines find and recrawl pages. Whether those pages rank depends on their content and signals.
How often should a sitemap update?
Whenever content is published, changed, or removed. Generated sitemaps in WordPress update automatically, so the main job is keeping bad URLs out.