Yoast SEO Sitemap: Complete Guide
How the Yoast SEO sitemap works in WordPress. Covers enabling, customizing, excluding content, troubleshooting, and when to use Yoast's sitemap vs. alternatives.
Yoast SEO is the most popular WordPress SEO plugin, and it includes an XML sitemap generator. When you install Yoast, it automatically creates a sitemap for your site -- no additional configuration required. But understanding how it works, what it includes, and how to customize it gives you more control over what search engines see.
This guide covers everything about Yoast's sitemap feature. For a general introduction to XML sitemaps, see our XML sitemap guide.
Where to Find Your Yoast Sitemap
After installing Yoast SEO, your sitemap is available at:
https://yourdomain.com/sitemap_index.xml
This is a sitemap index file that references individual sitemaps for each content type. A typical Yoast sitemap index looks like:
sitemap_index.xml
├── post-sitemap.xml
├── page-sitemap.xml
├── category-sitemap.xml
├── post_tag-sitemap.xml
└── author-sitemap.xml
Each sub-sitemap contains URLs for that specific content type. Yoast generates and updates these automatically whenever you publish, update, or delete content.
Enabling and Disabling the Sitemap
The sitemap is enabled by default when you install Yoast SEO.
To verify it is enabled:
- Go to Yoast SEO > Settings in the WordPress admin
- Look for the "Site features" section
- Find "XML sitemaps" and confirm it is toggled on
If you toggle it off, Yoast stops generating the sitemap and the sitemap URLs return 404. Only disable it if you have a specific reason (like using a different sitemap solution).
Conflict with WordPress core sitemaps
WordPress 5.5+ includes a built-in sitemap at /wp-sitemap.xml. When Yoast SEO is active, it automatically disables the WordPress core sitemap to prevent conflicts. You do not need to worry about having two competing sitemaps.
What Yoast Includes in the Sitemap
By default, Yoast includes:
Posts
All published posts are included in post-sitemap.xml. Draft, pending, private, and trashed posts are excluded. Password-protected posts are also excluded.
Pages
All published pages are included in page-sitemap.xml. The same visibility rules apply.
Categories
Published categories with at least one published post are included in category-sitemap.xml. Empty categories are excluded.
Tags
Published tags with at least one published post are included in post_tag-sitemap.xml. Empty tags are excluded.
Custom post types
If your theme or plugins register custom post types (like Products, Portfolios, Testimonials), Yoast creates a separate sitemap for each. For example, WooCommerce products appear in product-sitemap.xml.
Custom taxonomies
Similarly, custom taxonomies (like product categories in WooCommerce) get their own sitemaps.
Author archives
Author pages (/author/username/) are included in author-sitemap.xml by default. You can disable this.
Excluding Content from the Sitemap
There are several ways to keep specific content out of the Yoast sitemap.
Exclude an entire content type
To remove all posts of a certain type from the sitemap:
- Go to Yoast SEO > Settings
- Navigate to the content type you want to exclude (under "Content types" or "Taxonomies")
- Set "Show [content type] in search results" to off
When you set a content type to not show in search results, Yoast adds noindex to those pages and removes them from the sitemap. Be careful -- this affects indexing, not just the sitemap.
Exclude individual posts or pages
To exclude a single post or page:
- Edit the post or page in WordPress
- Scroll to the Yoast SEO meta box
- Click the "Advanced" tab
- Set "Allow search engines to show this post in search results?" to "No"
This adds a noindex meta tag and removes the URL from the sitemap.
Exclude author archives
If you do not want author pages in the sitemap:
- Go to Yoast SEO > Settings > Advanced > Author archives
- Disable author archives
This removes the author-sitemap.xml from the sitemap index.
Exclude tag pages
Many sites have thin tag pages that do not add value. To exclude them:
- Go to Yoast SEO > Settings > Taxonomies > Tags
- Set "Show Tags in search results" to off
Exclude date-based archives
Yoast does not include date-based archives in the sitemap by default, so no action is needed here.
Sitemap URL Limits
Yoast limits each sub-sitemap to 1,000 URLs by default. If you have 3,000 posts, Yoast creates three post sitemaps:
post-sitemap.xml (posts 1-1000)
post-sitemap2.xml (posts 1001-2000)
post-sitemap3.xml (posts 2001-3000)
All three are referenced in the sitemap index.
You can change this limit with a filter in your theme's functions.php:
add_filter( 'wpseo_sitemap_entries_per_page', function() {
return 2000;
} );
The protocol maximum is 50,000, but smaller values keep individual sitemap files manageable and faster to generate.
Yoast Sitemap and Images
Yoast includes images in the sitemap by default. Each URL entry includes references to images found in the post content:
<url>
<loc>https://example.com/blog-post/</loc>
<lastmod>2026-06-09T10:00:00+00:00</lastmod>
<image:image>
<image:loc>https://example.com/wp-content/uploads/photo.jpg</image:loc>
</image:image>
</url>
This helps Google discover and index your images for Google Image search. Yoast includes images from the post content area and the featured image.
Submitting the Yoast Sitemap
Google Search Console
- Log in to Google Search Console
- Select your site property
- Go to Sitemaps in the left menu
- Enter
sitemap_index.xml - Click Submit
You only need to submit the index file. Google follows the links to the individual sub-sitemaps automatically.
For a detailed walkthrough, see how to submit a sitemap to Google.
Bing Webmaster Tools
Submit the same sitemap_index.xml URL through Bing Webmaster Tools. See how to submit a sitemap to Bing.
robots.txt
Yoast automatically adds the sitemap reference to your site's robots.txt (which Yoast generates virtually in WordPress). You can verify by visiting https://yourdomain.com/robots.txt. You should see:
Sitemap: https://yourdomain.com/sitemap_index.xml
Troubleshooting Common Issues
Sitemap returns 404
Possible causes:
- Yoast sitemap feature is disabled (check Yoast SEO > Settings)
- Permalink settings need to be refreshed (go to Settings > Permalinks and click Save without changing anything)
- A caching plugin is interfering (clear your cache)
- Another plugin or server configuration is blocking the sitemap URL
- Your
.htaccessfile is missing or corrupted (Yoast sitemaps rely on WordPress rewrite rules)
Sitemap is empty
Possible causes:
- You have no published content of that type
- The content type is set to "noindex" in Yoast settings
- A filter or hook from another plugin is removing entries
URLs in sitemap return 404
If Google Search Console reports that URLs from your sitemap return 404:
- The content was deleted or unpublished after the sitemap was generated
- The permalink structure changed without proper redirects
- The URL slug was modified
Regenerate the sitemap by saving any post or page (Yoast regenerates automatically) or by refreshing permalinks.
Duplicate sitemap (Yoast + WordPress core)
If you see both /sitemap_index.xml (Yoast) and /wp-sitemap.xml (WordPress core), Yoast should be disabling the core sitemap automatically. If both exist, check that Yoast is properly installed and activated. The core sitemap should return a 404 when Yoast is active.
Sitemap generation is slow
For sites with tens of thousands of posts, sitemap generation can be slow. Reduce the entries per page (see the filter above) to make each sub-sitemap smaller and faster to generate. Ensure your database is optimized and your hosting can handle the query load.
Yoast Free vs. Yoast Premium
The sitemap feature is included in both Yoast SEO Free and Yoast SEO Premium. Premium adds features like redirect management, internal linking suggestions, and content insights, but the sitemap functionality is the same in both versions.
Yoast Sitemap vs. Alternatives
Yoast vs. WordPress core sitemap
The WordPress core sitemap (/wp-sitemap.xml) is basic. It includes pages and posts but lacks image support, has fewer customization options, and does not integrate with SEO settings. Yoast's sitemap is better for most sites because it respects your noindex settings, includes images, and provides a more complete implementation.
Yoast vs. Rank Math
Rank Math's sitemap feature is comparable to Yoast's. Both generate sitemap indexes, include images, and respect noindex settings. If you are already using Rank Math, there is no need to switch to Yoast for the sitemap. And vice versa.
Yoast vs. dedicated sitemap plugins
Plugins like XML Sitemap Generator for Google (formerly Google XML Sitemaps) offer more granular control over sitemap generation. If you need advanced features like separate sitemaps for custom post types with fine-grained inclusion rules, or you want to use a non-Yoast SEO plugin but still need a robust sitemap, a dedicated plugin may be a better fit.
Yoast vs. external generators
External sitemap generators crawl your site and produce a static XML file. This approach works if you want a sitemap that reflects exactly what Google sees (including any rendering issues), but it requires periodic regeneration. Yoast's dynamic approach is better for most WordPress sites because it updates automatically.
Advanced Customization
Excluding specific URLs programmatically
Use the wpseo_exclude_from_sitemap_by_post_ids filter:
add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', function() {
return [ 123, 456, 789 ]; // Post IDs to exclude
} );
Adding custom URLs
Yoast does not have a built-in way to add arbitrary URLs to the sitemap. If you need to include non-WordPress URLs, use the wpseo_sitemap_index filter to add custom sitemap entries to the index, or create a separate sitemap file and submit it independently.
Changing sitemap URL structure
By default, Yoast uses /sitemap_index.xml. You cannot change this URL through settings. It is hardcoded into Yoast's rewrite rules. If you need the sitemap at /sitemap.xml, create a redirect from /sitemap.xml to /sitemap_index.xml.
Summary
Yoast SEO generates a complete XML sitemap automatically for WordPress sites. It creates a sitemap index with separate sub-sitemaps for each content type, includes images, respects your noindex settings, and updates dynamically. Submit sitemap_index.xml to Google Search Console and Bing. Customize what is included through Yoast's settings or programmatically with filters. If the sitemap returns a 404, refresh your permalinks.
Generate and validate your sitemap
Crawl your WordPress site and compare against what Yoast generates. Catch missing pages and errors.
Try Instant Sitemap