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.

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!

How to enable and view the XML sitemap in Yoast SEO

Follow these steps to enable and view the XML sitemaps in Yoast SEO:

  1. Log in to your WordPress website

    When you’re logged in, you will be in your Dashboard.

  2. Click on Yoast SEO

    On the left-hand side, you will see a menu. In that menu, click on Yoast SEO.

  3. Go to Settings

    The Yoast SEO menu will expand: click on Settings.
    Screenshot of the settings menu item in Yoast SEO

  4. In Site features, in the APIs section, toggle the switch to on

    You will see a purple checkmark when the feature is enabled. To disable the feature, toggle the switch off. The XML sitemap card in the Site features settings in Yoast SEO

  5. To view the sitemap, click on View the XML sitemap

    Your site’s XML sitemap will open in a new tab.
    The button "View XML sitemap" in the Yoast SEO Site features settings

How to limit the number of sitemap entries

You can limit the number of sitemap entries by using the filter wpseo_sitemap_entries_per_page. Here is an 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' );

How to add an external sitemap

Want to add an external sitemap? Follow our 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.

I’m having issues with my sitemap

Are you having issues with your sitemap? We offer several guides to help you with your problems. Is your sitemap not updating? Do you wonder why it shows gray links? Is your sitemap a blank page? Or are you looking for common XML sitemap errors?

If you have a sitemap that is located on example.com/sitemap.xml, your sitemap is not being generated by our Yoast SEO plugin. It is probably generated by another plugin or WordPress core itself. Please disable other sitemap plugins and remove any physical sitemap files via FTP before enabling the sitemaps in our plugin.
XML sitemaps do not need to be indexed by search engines in order to be read or parsed. Therefore, we add a x-robots-tag HTTP header (with a value of noindex, follow) to all XML sitemap responses.

Did this article answer your question?

Thanks for your feedback!

Related articles

Get free SEO tips!