XML sitemaps in the Yoast SEO plugin
Having an XML sitemap can be beneficial for SEO. It allows search engines to find and crawl your most important pages! The sitemap index and individual sitemaps in Yoast SEO are updated automatically as you add or remove content. What is more, they include the post types you want search engines to index. For example, Post Types marked as ‘noindex’ will not appear in the sitemap. To learn more about how to noindex see: How do I noindex URLs?
Warning: Undefined array key “className” in /home/staging-yoast/staging-platform.yoast.com/versions/05aa62c2ec01538957086672ffa4a059780fd784/web/app/themes/yoast-theme/html_includes/blocks/landing-page/block-landing-page-list.php on line 21
You can improve the way search engines crawl your site with the Crawl optimization settings in Yoast SEO Premium! They allow you to remove unnecessary URLs, so search engines can crawl your site more efficiently!
Table of contents
How to enable and view the XML sitemap in Yoast SEO
Follow these steps to enable and view the XML sitemaps in Yoast SEO:
- Log in to your WordPress website.
When you’re logged in, you will be in your ‘Dashboard’.
- Click on ‘SEO’
On the left-hand side, you will see a menu. In that menu, click on ‘Yoast SEO’
- Click on ‘Settings’.
The ‘Yoast SEO’ settings will expand, providing you with additional options. Click on ‘Settings’.
- In the XML sitemaps card, toggle the switch next to “Enable feature”.
To enable the feature, toggle the switch on. To disable the feature, toggle the switch off.
- To view the sitemap, click the button “View the XML sitemap”.
Your site’s XML sitemap will open in a new tab.
Limit the number of sitemap entries
You can limit the number of sitemap entries by using the filter wpseo_sitemap_entries_per_page
. Here follows example code to limit the max entries to 100.
/* Limit the number of sitemap entries for Yoast SEO */
function max_entries_per_sitemap() {
return 100;
}
add_filter( 'wpseo_sitemap_entries_per_page', 'max_entries_per_sitemap' );
Add an external sitemap
Want to add an external sitemap? Use this guide.
Can I change the sitemap priority?
We’ve decided to remove the priority variables from our XML sitemaps in the 3.5 version of Yoast SEO, as Google has said publicly that they don’t use them on most sites.
Are you having issues with your sitemap?
Maybe you need a different guide after enabling the sitemap. Is your sitemap not updating? Do you wonder why it shows grey links? Is your sitemap a blank page? Or are you looking for common XML sitemap errors? You can also use our search bar at the top to search for your specific issue.
x-robots-tag
HTTP header (with a value of noindex, follow
) to all XML sitemap responses.