Skip to content

WordPress

WordPress sitemap: where it is, how to create one, and what to include

WordPress sitemaps are XML files that list the public URLs of a WordPress site, such as posts, pages and archives, so search engines can find them without following every link. WordPress has generated one at /wp-sitemap.xml since version 5.5, and SEO plugins such as Yoast SEO and Rank Math offer their own.

Last reviewed October 12, 2026 · 8 min read

Reviewed by Yurii, Founder of Structura

On WordPress, building the file is automatic. The work is making sure one sitemap is in use, that it lists only the URLs you want in search, and that Google knows where to find it.

Where to find your WordPress sitemap

The URL depends on what generates the sitemap:

What generates it Sitemap index URL
WordPress core (5.5 or later), with no SEO plugin sitemap /wp-sitemap.xml
Yoast SEO /sitemap_index.xml, and requests to /sitemap.xml redirect there
Rank Math /sitemap_index.xml
A dedicated sitemap plugin Whatever its settings page shows

Each of these is a sitemap index: a short file that links to the individual sitemaps for posts, pages, categories and so on. If you are not sure which applies, open /robots.txt, where WordPress adds a reference to its sitemap index, or the Sitemaps report in Google Search Console.

If /wp-sitemap.xml shows nothing, check two things. Under Settings, Reading, the option to discourage search engines from indexing the site turns the core sitemaps off. And core sitemaps need the SimpleXML PHP extension; without it, WordPress shows an error message with a 501 status instead of the sitemap.

What the core sitemap includes

The built-in sitemap arrived in WordPress 5.5. The release announcement says it covers "all public and publicly queryable post types and taxonomies, as well as for author archives and of course the homepage of the site." Each sitemap holds up to 2,000 URLs and the index up to 50,000 sitemaps, which is more than any blog needs. Since WordPress 6.5, the entries for individual posts and the homepage also carry a lastmod date.

That date is the optional field worth having. Google ignores the priority and changefreq values, but it uses lastmod "if it's consistently and verifiably" accurate, which means it should change when the content does, not when a footer year ticks over.

What core leaves out: image, video and news sitemaps. The announcement says these extensions "are usually only useful for a small number of websites" and leaves them to plugins.

How to create or change a sitemap in WordPress

You rarely create a WordPress sitemap from scratch. You decide which generator owns it, then trim what it lists.

Option 1: keep the core sitemap

With no SEO plugin, the core sitemap is already live. Developers shape it with filters added in 5.5: wp_sitemaps_post_types and wp_sitemaps_taxonomies drop a post type or taxonomy, wp_sitemaps_add_provider removes a whole provider such as users, and wp_sitemaps_posts_query_args excludes single posts. This snippet, placed in a small plugin or a child theme's functions.php, drops tag archives and author archives:

add_filter( 'wp_sitemaps_taxonomies', function ( $taxonomies ) {
	unset( $taxonomies['post_tag'] );
	return $taxonomies;
} );

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

Option 2: use your SEO plugin's sitemap

Most WordPress sites already run an SEO plugin, and its sitemap is usually the better choice because it follows the indexing settings you set in the same plugin. Yoast's sitemap specification excludes pages that output a noindex directive, pages whose canonical URL points somewhere else, private and password-protected pages, and paginated archive views such as /blog/page/2/. Rank Math lets you exclude posts and whole terms by ID, decide whether images and featured images are listed, and caps each sitemap at 200 links by default, down from 1,000, because in its words "Google responds better to smaller pages in sitemaps."

Whichever you use, keep one sitemap live and make it the one you submit and the one your robots.txt names. If /wp-sitemap.xml still loads next to your plugin's index, a developer can switch core off with add_filter( 'wp_sitemaps_enabled', '__return_false' );, the filter the 5.5 announcement documents for that purpose. If you are still choosing a plugin, our roundup of SEO plugins for WordPress compares the main options.

What to include and what to leave out

Google's rule is short: "Include the URLs in your sitemap that you want to see in Google's search results." Where the same content is reachable at several addresses, list only the canonical one. On a WordPress blog that works out like this:

URL type In the sitemap? Why
Posts and pages you want found Yes That is what the file is for
Category archives that work as topic hubs Usually They gather the posts on one subject
Tag archives Only curated ones Tags with one or two posts produce thin pages that repeat excerpts
Author archives Only on multi-author sites Rank Math recommends author archives only "if multiple authors publish on your site"
Attachment pages for single images No Each is a page around one file
Pages set to noindex No Listing them asks Google to show pages you told it to drop
Redirected or deleted URLs No Only URLs that return 200 belong in it

Thin tag archives are also where WordPress sites pick up duplicate content: keeping them out of the sitemap is half the fix, and noindexing or consolidating them is the other half.

Then check the reverse. Every URL in the sitemap should also be linked from somewhere on the site. A post that appears in the sitemap but in no menu, archive or article is an orphan page: Google may find it, but it gets none of the context a link carries.

Submit the sitemap to Google Search Console

  1. Open Search Console and select the property for your site.
  2. Open the Sitemaps report.
  3. Enter the index URL, such as sitemap_index.xml or wp-sitemap.xml, and submit it.
  4. Come back after a few days to check the status and the number of discovered URLs.

Submit the index, not every child sitemap. Google accepts "that single index file," and the report then shows "when Googlebot accessed the sitemap and also potential processing errors." The Sitemap: line in robots.txt is a second route that needs no account: Google says it will find the sitemap "the next time we crawl your robots.txt file." Neither route forces indexing. A sitemap gets URLs discovered; whether the posts then rank is the work covered under blog SEO.

HTML sitemaps

An HTML sitemap is an ordinary page that lists your posts and pages for people rather than crawlers. WordPress core does not create one; Rank Math can, through a shortcode or on a page you choose. It helps visitors on a large site, but it does not replace links between related posts.

Sitemaps on a headless site

When WordPress or another CMS only stores the content and a separate front end serves the public pages, the sitemap belongs to the front end, because that is where the public URLs live. Generate it from the content API at build or request time, list only public canonical URLs that return a 200, fill lastmod from each post's real update date, and name it in the robots.txt on the public domain. The headless CMS SEO checklist covers the rest of what the front end takes over.

How Structura handles this

Structura does not build or submit sitemaps. On WordPress it publishes native posts, so each one appears in whatever sitemap your site already runs, core or SEO plugin, the moment it is published, and follows that plugin's settings like a post you wrote yourself. If Yoast SEO, Rank Math, SEOPress or All in One SEO is active, Structura fills its focus keyphrase field and leaves article structured data to it.

For engines other than Google, the IndexNow channel announces each new post URL to Bing, Yandex and the other participating engines as soon as it publishes. Google does not take part in IndexNow, so for Google your sitemap and internal links still do that job.

On headless sites, the Content API's post list returns every published post's slug with its publishedAt and updatedAt dates, 50 posts per page with cursors, which is what a sitemap route needs. Your front end builds the file; Structura does not trigger builds. With Google Search Console connected on a paid plan, Structura shows whether Google has indexed each post, and on headless sites it flags a post that Google still has not indexed two weeks after publication. The blog SEO software page shows what each post includes and what the Search Console checks report.

FAQ

How do I find my website's sitemap?

On WordPress 5.5 or later, try /wp-sitemap.xml first, then /sitemap_index.xml, which Yoast SEO and Rank Math use. If neither loads, open /robots.txt and look for a line that starts with "Sitemap:". For a site you own, the Sitemaps report in Google Search Console shows what has been submitted.

What is the best WordPress sitemap plugin?

For most sites it is the SEO plugin you already run. Yoast SEO and Rank Math both generate sitemaps that follow the noindex and canonical settings you set in the same plugin, which keeps the sitemap and your indexing decisions in one place. A site with no SEO plugin is fine on the core sitemap; a dedicated sitemap plugin earns its place mainly when you need image, video or news sitemaps, which core leaves out.

How do I add an XML sitemap file in WordPress?

Usually you don't. WordPress and SEO plugins generate the sitemap on request, so it updates whenever you publish, while a static sitemap.xml uploaded to the site root goes stale with the first new post. If you need custom URLs in the core sitemap, a developer can register an extra provider with wp_register_sitemap_provider(), which the WordPress 5.5 announcement documents with an example.

No. Google calls a submitted sitemap "merely a hint," and it carries none of the context a link does: which pages matter, how they relate, and what the linked page is about. Visitors cannot use a sitemap to move between posts either. Keep the sitemap for discovery and link related posts to each other for everything else.

Share this post