What is wp-sitemap.xml?

/wp-sitemap.xml is the address of the XML sitemap built into WordPress. A public WordPress site serves it automatically, with no plugin. The file is a sitemap index that links to further sitemaps for posts, pages, other public post types, taxonomies and users.

It covers the basics. It has no settings screen, so anything beyond the defaults means code or a plugin.

What it contains

Requesting https://example.com/wp-sitemap.xml returns an index like this:

xml
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap><loc>https://example.com/wp-sitemap-posts-post-1.xml</loc></sitemap>
  <sitemap><loc>https://example.com/wp-sitemap-posts-page-1.xml</loc></sitemap>
  <sitemap><loc>https://example.com/wp-sitemap-taxonomies-category-1.xml</loc></sitemap>
  <sitemap><loc>https://example.com/wp-sitemap-taxonomies-post_tag-1.xml</loc></sitemap>
  <sitemap><loc>https://example.com/wp-sitemap-users-1.xml</loc></sitemap>
</sitemapindex>

Three providers feed it:

  • Posts: every public post type, one set of files per type. Entries for posts carry a lastmod date taken from the post's modified time.
  • Taxonomies: terms of every public taxonomy.
  • Users: author archives of users who have published posts.

Each file holds up to 2,000 URLs, after which a second page is created: wp-sitemap-posts-post-2.xml. The sitemap protocol allows 50,000, and core chose the lower number to keep each file quick to generate.

How search engines find it

WordPress adds a line to its virtual robots.txt:

code
Sitemap: https://example.com/wp-sitemap.xml

Crawlers that read robots.txt pick it up from there. Submitting the address once in Search Console and Bing Webmaster Tools is still worth doing, because you then get a report on whether it was read and how many URLs were found; see submit a sitemap to Google.

The sitemap is switched off when Discourage search engines from indexing this site is ticked under Settings → Reading, and the robots.txt line disappears with it.

What it leaves out

  • No awareness of noindex. Core has no per-post noindex setting, so it cannot exclude pages on that basis. A page you noindex by other means stays listed.
  • No image, video or news entries.
  • No controls. You cannot untick a post type, a taxonomy or a single URL in the admin.
  • Author archives are included by default, even on a single-author site where they duplicate the blog index.
  • No caching layer of its own. Each sitemap page is generated by a database query when requested.

Everything is adjustable in code through filters. For example, to drop the users sitemap:

php
add_filter( 'wp_sitemaps_add_provider', function ( $provider, $name ) {
	return 'users' === $name ? false : $provider;
}, 10, 2 );

Other filters change the included post types and taxonomies, the query for each, and the 2,000 limit.

Core sitemap or plugin sitemap?

For a small site with posts and pages, the core sitemap is enough. A plugin sitemap earns its place when you need to exclude noindexed or redirected content, pick which types and taxonomies are listed, include images, or add video and news sitemaps.

Run one or the other, not both. Two sitemaps listing different sets of URLs give search engines conflicting information. SEO plugins that ship their own sitemap normally disable the core one. Hydrogen SEO does this, serving its index at /sitemap.xml with per-type switches; see XML sitemaps. If a /wp-sitemap.xml you expected returns a 404, that is the usual reason.

To switch the core sitemap off without a plugin:

php
add_filter( 'wp_sitemaps_enabled', '__return_false' );

Checking yours

Open /wp-sitemap.xml in a browser. WordPress applies a stylesheet, so you see a readable table instead of raw XML. Click into each child sitemap and look for URLs that should not be there: test pages, thin tag archives, author pages. Then run a file through our XML sitemap validator. If something is wrong or missing, sitemap troubleshooting lists the usual causes.

Common questions

Does WordPress have a built-in sitemap?

Yes. WordPress generates one at /wp-sitemap.xml on public sites, with no plugin needed. It lists public post types, taxonomies and author archives.

Why does /wp-sitemap.xml show a 404?

Either an SEO plugin has replaced the core sitemap with its own at another address, the site is set to discourage search engines, or the permalink rules need refreshing by saving Settings, then Permalinks.

How many URLs does wp-sitemap.xml hold?

Each child sitemap lists up to 2,000 URLs by default. Larger sites get additional numbered pages, all linked from the index.