Key takeaways
- WordPress has a built-in sitemap at
/wp-sitemap.xml; SEO plugins replace it with their own (often/sitemap_index.xml). - Use one sitemap system, include only indexable canonical URLs, and submit it to Search Console and Bing.
- Exclude noindexed content, thin archives and user sitemaps where they add no value.
An XML sitemap tells search engines which URLs on your site matter. WordPress makes one automatically, and SEO plugins make better-configured ones. The trick is making sure the sitemap is clean, consistent and submitted.
Core sitemap vs SEO plugin sitemaps#
| WordPress core | Yoast / Rank Math | |
|---|---|---|
| URL | /wp-sitemap.xml |
/sitemap_index.xml |
| Excludes noindex pages | Not by default (themes/plugins can filter) | Yes |
| Image entries | No | Yes |
| Last modified dates | Limited | Yes |
| Control per type/taxonomy | Via code | Settings screen |
This theme improves the core sitemap: it excludes posts you mark noindex and removes the user sitemap. If you install an SEO plugin, its sitemap takes over and the core one is disabled.
What should be in your sitemap#
- Posts, pages and public custom post types you want indexed.
- Main category archives with real content.
- Only canonical, 200-status URLs.
What should not be#
- Noindexed pages, redirects, 404s.
- Thin tag archives, author archives on single-author blogs, attachment pages.
- Staging or test pages.
Need a hand with this?
Get a quick, honest review of your website’s SEO.
Submitting and monitoring#
- Open your sitemap URL in a browser to check it loads.
- Google Search Console → Sitemaps → submit the index URL.
- Bing Webmaster Tools → Sitemaps → submit (you can import from Search Console).
- Make sure
robots.txtincludes aSitemap:line (WordPress adds it automatically). - Check Search Console’s Pages report filtered by sitemap to see indexing issues for listed URLs.
Customising the core sitemap with code#
// Remove the users sitemap
add_filter( 'wp_sitemaps_add_provider', function ( $provider, $name ) {
return 'users' === $name ? false : $provider;
}, 10, 2 );
// Exclude a post type
add_filter( 'wp_sitemaps_post_types', function ( $types ) {
unset( $types['testimonial'] );
return $types;
} );
Common problems#
- 404 on /wp-sitemap.xml: flush permalinks (Settings → Permalinks → Save) or another plugin disabled it.
- “Couldn’t fetch” in Search Console: security plugins or firewalls blocking Googlebot; caching serving an HTML page.
- Two sitemaps submitted: remove the old one after switching plugins.
Concepts: XML sitemap.
WordPress sitemap FAQ#
Do small sites need a sitemap?#
It’s still helpful for discovery and monitoring, and WordPress makes one automatically.
How often is the sitemap updated?#
Automatically, whenever content changes.
Should I add a sitemap link in the footer?#
Optional. XML sitemaps are for search engines; an HTML sitemap page can help users on large sites.