XML sitemaps in the Yoast SEO plugin

Having an XML sitemap can be beneficial for SEO. It allows Google to understand your site structure, and retrieve essential pages of a website very fast, even if the internal linking of a site isn’t flawless.

You can significantly improve your site structure with the internal linking tool and the content filter features in Yoast SEO Premium!

The sitemap index and individual sitemaps 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?

Read more: What is an XML sitemap and why should you have one?

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 ‘SEO’

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

  3. Click on ‘General’.

    The ‘SEO’ settings will expand providing you with additional options. Click on ‘General’.
    Screenshot of the SEO menu in the WordPress admin menu with the General menu item that needs to be clicked on

  4. Click on the ‘Features’ tab.

    Screenshot of the tabs in the Yoast SEO General settings screen, with the Features tab that needs to be clicked on

  5. Toggle the ‘XML Sitemaps’ switch and click ‘Save Changes’ at the bottom of the screen.

    To enable the feature, toggle the switch to ‘On’.
    To disable the feature, toggle the switch to ‘Off’.

    A screenshot of the Features in the features tab, including the XML sitemaps, with the toggle switched On

  6. To view the sitemap, click the question mark next to the XML sitemaps feature.

    A link to the XML sitemaps will appear.
    Screenshot of the XML sitemaps feature item in the Features tab, with the toggle switched on

  7. Click the ‘See the XML sitemap’ link.

    The XML sitemap will open in a new tab.
    A screenshot of the XML sitemaps feature with the link "See the XML sitemap" that the user needs to click on

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. If you are not sure where it would go or how to add this code, we suggest working with a Yoast Partner here who can help.

/* 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.

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.

Get free SEO tips!