WordPress Sitemap Guide
How WordPress sitemaps work: built-in core sitemaps, Yoast SEO, Rank Math, finding your sitemap URL, customizing what's included, and troubleshooting common issues.
WordPress has had built-in sitemap support since version 5.5, released in August 2020. Before that, you needed a plugin. Now you have three options: the core sitemap, Yoast SEO's sitemap, or Rank Math's sitemap. Each works differently, includes different content by default, and gives you different levels of control.
Here's how to find your WordPress sitemap, what each option does, and how to customize them.
Finding Your WordPress Sitemap
The first step is knowing where your sitemap lives. The URL depends on which system is generating it.
| Generator | Sitemap URL | Type |
|---|---|---|
| WordPress Core | /wp-sitemap.xml | Sitemap index |
| Yoast SEO | /sitemap_index.xml | Sitemap index |
| Rank Math | /sitemap_index.xml | Sitemap index |
| All in One SEO | /sitemap.xml | Sitemap index |
To check which one is active on your site, try visiting each URL. The one that returns valid XML is your active sitemap. If you have an SEO plugin installed, it typically disables the core WordPress sitemap automatically and takes over.
Quick check
Visit yourdomain.com/wp-sitemap.xml in your browser. If you see an XML sitemap index, WordPress core is generating your sitemap. If it 404s, an SEO plugin is likely handling it instead. Try yourdomain.com/sitemap_index.xml next.
WordPress Core Sitemaps (Built-in)
Since WordPress 5.5, every WordPress installation generates a sitemap automatically with no plugins required. It lives at /wp-sitemap.xml.
What It Includes by Default
The core sitemap generates a sitemap index that references individual sitemaps for:
- Posts (
/wp-sitemap-posts-post-1.xml) - Pages (
/wp-sitemap-posts-page-1.xml) - Custom post types (if registered with
public => true) - Categories (
/wp-sitemap-taxonomies-category-1.xml) - Tags (
/wp-sitemap-taxonomies-post_tag-1.xml) - Custom taxonomies (if registered as public)
- Authors (
/wp-sitemap-users-1.xml)
Each sub-sitemap contains up to 2,000 URLs (the core sitemap uses a lower limit than the protocol's 50,000 maximum).
What It Doesn't Include
The core sitemap is intentionally minimal:
- No
<lastmod>dates (a significant limitation) - No
<changefreq>or<priority>tags - No image sitemap support
- No news sitemap support
- No way to exclude individual pages from the WordPress admin
Customizing Core Sitemaps
Customization requires code. WordPress provides filters to modify the core sitemap behavior:
// Remove a post type from the sitemap
add_filter('wp_sitemaps_post_types', function($post_types) {
unset($post_types['attachment']);
return $post_types;
});
// Remove a taxonomy from the sitemap
add_filter('wp_sitemaps_taxonomies', function($taxonomies) {
unset($taxonomies['post_tag']);
return $taxonomies;
});
// Remove the users/authors sitemap entirely
add_filter('wp_sitemaps_add_provider', function($provider, $name) {
if ($name === 'users') {
return false;
}
return $provider;
}, 10, 2);
// Disable core sitemaps entirely
add_filter('wp_sitemaps_enabled', '__return_false');
This code goes in your theme's functions.php or a custom plugin. There's no settings page for core sitemaps.
When Core Sitemaps Are Enough
The core sitemap is adequate if:
- You have a simple site (blog, small business)
- You don't need lastmod dates (though you really should want them)
- You don't need fine-grained control over which pages are included
- You're not using a dedicated SEO plugin
For most serious WordPress sites, an SEO plugin's sitemap is the better option.
Yoast SEO Sitemaps
Yoast SEO is the most popular WordPress SEO plugin, and its sitemap implementation is significantly more capable than the core sitemap.
What Yoast Provides
When Yoast is active, it automatically disables the WordPress core sitemap and takes over at /sitemap_index.xml.
Automatic lastmod dates
Yoast includes <lastmod> on every URL, based on the post's last modified date. This is the most important metadata field for search engines, and the core sitemap doesn't include it.
Image sitemap support
Yoast adds image references to each URL entry, helping Google discover images associated with your content.
Per-post/page exclusion
In the Yoast meta box on any post or page, you can set it to "noindex," which also removes it from the sitemap. No code required.
Post type control from settings
In Yoast's settings under Search Appearance, you can toggle entire post types and taxonomies in or out of the sitemap.
Automatic robots.txt reference
Yoast adds the Sitemap: directive to your virtual robots.txt automatically.
Configuring Yoast Sitemaps
Verify sitemaps are enabled
Go to Yoast SEO > Settings > Site Features. Under "APIs," make sure "XML sitemaps" is toggled on. Visit /sitemap_index.xml to confirm.
Control which post types are included
In Yoast SEO > Settings > Content Types, you can configure each post type. Set "Show in search results" to off for any post type you want excluded from the sitemap.
Control which taxonomies are included
In Yoast SEO > Settings > Categories & Tags, toggle visibility for categories, tags, and any custom taxonomies. Disabled taxonomies are excluded from the sitemap.
Exclude individual pages
Edit any post or page. In the Yoast SEO panel, go to the Advanced tab. Set "Allow search engines to show this page in search results?" to No. This adds a noindex tag and removes the URL from the sitemap.
Validate your WordPress sitemap
Check your Yoast or Rank Math sitemap for errors, broken URLs, and schema issues. Know exactly what Google sees.
Rank Math Sitemaps
Rank Math is the other major SEO plugin, and it offers similar sitemap functionality to Yoast with some additional features.
Key Differences from Yoast
- Sitemap URL: Same as Yoast --
/sitemap_index.xml - lastmod support: Yes, included on all entries
- Image sitemap: Yes, included by default
- Video sitemap: Available in the Pro version
- News sitemap: Available in the Pro version
- Max URLs per sitemap: Configurable (default 200, up to 50,000)
Configuring Rank Math Sitemaps
Go to Rank Math > Sitemap Settings. The interface is more granular than Yoast's:
- General tab: Enable/disable sitemaps, set max URLs per sitemap file, include images, exclude specific posts or terms by ID
- Post type tabs: Toggle each post type individually, with options for images and custom robots directives
- Taxonomy tabs: Same granular control for categories, tags, and custom taxonomies
Rank Math also lets you directly exclude specific post IDs from the sitemap without needing to change the post's indexing status, which Yoast doesn't offer through its UI.
Core vs Plugin: Which Should You Use?
| Feature | WP Core | Yoast SEO | Rank Math |
|---|---|---|---|
| lastmod dates | No | Yes | Yes |
| Image sitemap | No | Yes | Yes |
| Per-page exclusion (UI) | No | Yes | Yes |
| Post type toggle (UI) | No | Yes | Yes |
| Taxonomy control (UI) | No | Yes | Yes |
| News sitemap | No | No (addon) | Pro only |
| Video sitemap | No | No (addon) | Pro only |
| Configurable URL limit | No (fixed 2000) | No (fixed 1000) | Yes |
| Requires plugin | No | Yes (free) | Yes (free) |
| Auto robots.txt | No | Yes | Yes |
The recommendation is straightforward: If you're running any serious WordPress site, use an SEO plugin. The core sitemap's lack of lastmod dates alone makes it inferior for SEO purposes. Yoast and Rank Math are both free and both generate better sitemaps than the core system.
If you already have Yoast or Rank Math installed for other SEO features, their sitemaps are active by default. There's nothing else to do.
Common WordPress Sitemap Issues
The Sitemap Returns a 404
Possible causes:
- Permalinks need to be flushed. Go to Settings > Permalinks and click "Save Changes" without changing anything. This regenerates the rewrite rules.
- Your SEO plugin is deactivated or misconfigured
- A caching plugin is serving a stale 404
- Your
.htaccessfile (or Nginx config) has conflicting rewrite rules
The Sitemap Includes Pages You Want Excluded
Fix: Use your SEO plugin's per-post settings to mark pages as noindex. In Yoast, edit the page and use the Advanced tab. In Rank Math, use the Advanced tab in the Rank Math meta box. Pages marked noindex are automatically excluded from the sitemap.
The Sitemap Includes Author Archives
Author archive sitemaps (/wp-sitemap-users-1.xml in core, or author-sitemap.xml in plugins) are included by default. If your site has a single author or you don't want author pages indexed, disable them.
In Yoast: Settings > Content Types > Authors, set "Show author archives in search results" to off.
In Rank Math: Sitemap Settings > Authors, toggle off.
In core: Use the wp_sitemaps_add_provider filter shown earlier.
Plugin Conflicts
If you have multiple SEO plugins active (e.g., Yoast and Rank Math simultaneously), they'll fight over sitemap generation. Only use one SEO plugin at a time. Deactivate the one you're not using.
Some caching plugins can also interfere with sitemap generation by caching the XML output and serving stale content. If your sitemap doesn't reflect recent changes, clear your cache.
Missing Images in Sitemap
If your sitemap doesn't include image references, check that your SEO plugin's image sitemap feature is enabled. In Yoast, this is automatic. In Rank Math, verify it's toggled on in Sitemap Settings.
After any sitemap change, validate
Whenever you change sitemap settings, exclude pages, or switch plugins, visit your sitemap URL in the browser to verify it's valid XML. Then check Google Search Console to confirm Google can process it. Changes can take a few days to be reflected in Search Console's sitemap report.
Submitting Your WordPress Sitemap
Once your sitemap is configured and generating correctly:
Verify the sitemap URL works
Visit your sitemap URL in the browser. You should see a valid XML sitemap index. Click into the sub-sitemaps to verify they contain the expected URLs.
Check robots.txt
Visit yourdomain.com/robots.txt. If you're using Yoast or Rank Math, the Sitemap: directive should already be there. If using core sitemaps, you may need to add it manually or via a plugin.
Submit to Google Search Console
In Search Console, go to Sitemaps in the left menu. Enter your sitemap URL and click Submit. Google will process it and report any errors.
Submit to Bing Webmaster Tools
In Bing Webmaster Tools, go to Sitemaps and submit the same URL. Bing processes sitemaps independently from Google.
Monitor ongoing status
Check Search Console's sitemap report periodically. Look at the submitted vs. indexed URL count. A large gap may indicate content quality issues, crawl errors, or configuration problems.
The Bottom Line
WordPress handles sitemaps out of the box, but the built-in implementation is bare-bones. If you care about SEO -- and you should -- use Yoast or Rank Math for sitemap generation. They provide lastmod dates, image support, per-page control, and automatic robots.txt integration. Configure once, submit to Search Console, and then monitor to make sure everything stays healthy.
Related Articles
WordPress gives you a sitemap for free. An SEO plugin gives you a good one.
Validate your XML sitemap
Check your sitemap for errors, broken URLs, and indexing issues. Free instant validation.