Technical SEO guide

XML sitemaps in WordPress: how they work and what to include

By Anis Harbaoui, SEO specialist · Published 2 November 2026 · Updated 12 November 2026

An XML sitemap is a file that lists the URLs you want search engines to find and index, with the date each one last changed. WordPress has generated a basic sitemap on its own since version 5.5, and SEO plugins replace it with one you can control. A good sitemap is short on purpose: only pages you want in Google belong in it.

Key takeaways
  • A sitemap helps discovery. It does not force indexing.
  • List only canonical, indexable URLs that return 200.
  • Google ignores priority and changefreq, but uses an accurate lastmod.
  • One sitemap file holds up to 50,000 URLs or 50 MB uncompressed.

What does an XML sitemap do?

It tells search engines which URLs exist and when they changed, so new and updated pages get found faster. It is a hint, not an order. Google still decides what to crawl and index, mostly based on the quality and links of each page.

Does WordPress create a sitemap by default?

Yes. Since WordPress 5.5, core serves a sitemap index at /wp-sitemap.xml with lists for posts, pages, taxonomies and authors. It works, but it gives you little control over what goes in. SEO plugins usually serve their own sitemap with exclusion rules instead.

What should and should not be in a sitemap?

Include the pages you want to rank. Leave out everything else:

IncludeLeave out
Posts, pages and products you want indexedNoindexed pages
Category pages with real contentRedirected or deleted URLs
The canonical version of each URLDuplicate or parameter URLs
Important images, if image search matters to youThin archives and utility pages

A sitemap full of URLs that redirect or are noindexed sends mixed signals. See noindex in WordPress for which pages to keep out.

What are the limits of a sitemap file?

A single sitemap can list up to 50,000 URLs or 50 MB uncompressed. Larger sites split their URLs across several sitemaps and list them in a sitemap index, which is the one file you submit.

Do priority and changefreq matter?

Not for Google. It ignores both values. It does use lastmod, but only when the date is consistently accurate. A sitemap that stamps every URL with today’s date teaches Google to ignore that field.

How do you submit a sitemap to Google?

Open the Sitemaps report in Google Search Console, enter the sitemap index URL and submit it. Then add a Sitemap: line to your robots.txt so every crawler can find it. Our robots.txt guide shows the format.

How to do it with NexalSEO

NexalSEO serves a sitemap index at /sitemap.xml with one sitemap per post type and taxonomy. Under Nexal SEO → XML Sitemap you can:

  1. Choose which post types and taxonomies are included.
  2. Exclude individual posts or terms by ID.
  3. Optionally leave out thin content below a word-count threshold.
  4. Include images in the sitemap.

Any page you set to noindex is removed from the sitemap automatically, so the two never contradict each other.

Frequently asked questions

Do I need a sitemap if my site is small?

Not strictly. Google can find a small, well-linked site through its links. A sitemap still helps new pages get discovered faster and costs nothing.

Should I use the WordPress core sitemap or a plugin sitemap?

Use one, not both. A plugin sitemap gives you control over exclusions. Submit only the sitemap you actually maintain.

Why are sitemap URLs “discovered but not indexed”?

Being in a sitemap does not guarantee indexing. Google may judge the page thin, duplicate or low priority. Improve the page and its internal links first.

Why is my WordPress sitemap not updating with new posts?

When a new post does not appear in your XML sitemap, the cause is usually one of these:

  • Caching. A page cache or CDN is serving an old copy of the sitemap. Purge the cache, and exclude sitemap*.xml URLs from page caching.
  • The post is excluded. Noindexed posts, drafts, scheduled and private posts are left out by design, and some plugins also skip very thin content.
  • The post type or taxonomy is switched off in the sitemap settings.
  • Two sitemaps. WordPress core, a theme or another plugin outputs its own sitemap, and you are looking at the wrong one. Check the URL submitted in Search Console.

If the sitemap is correct but Google is slow, that is normal: Google reads sitemaps on its own schedule. Make sure each URL has an accurate lastmod, and use URL Inspection to request indexing for important new pages. In NexalSEO, the sitemap health panel shows exactly which URLs are included and why any are left out.

Related guides

Noindex in WordPress

Keep pages out of search the right way.

robots.txt in WordPress

Point crawlers to your sitemap.

Internal linking strategy

Links still matter more than a sitemap.

Sitemaps that clean themselves

The NexalSEO WordPress SEO plugin keeps noindexed and, optionally, thin pages out of your sitemap. All options are in the sitemap documentation.

See the sitemap module