How to create a sitemap in WordPress

    July 21, 2021

    In the WordPress 5.5 release, a new sitemap feature was added to the core. This means that you do not need to use an additional plugin in order to generate a sitemap for your site. Sitemaps are important since they allow search engines to use the file to crawl your site. They contain the information that is needed by Google and Bing search engines.


    The sitemap XML feature in WordPress will output to the following URL;


    https://sitedomain.com/wp-sitemap.xml


    There are a number of plugins that will allow you to control what it outputs in the sitemaps feature in WordPress, such as WP Sitemaps Config. You can access the plugin’s settings from:


    Settings > XML Sitemaps


    If you need to remove users being output in the sitemap results on your site, you can use this code snippet:


    add_filter( 'wp_sitemaps_add_provider', function ($provider, $name) {

      return ( $name == 'users' ) ? false : $provider;

    }, 10, 2);


    If you need to remove the sitemap’s output from WordPress completely, you can use this code snippet to do so:


    add_filter( 'wp_sitemaps_enabled', '__return_false' );


    One of the most commonly used SEO plugins for WordPress is Yoast SEO.

    The Yoast SEO plugin includes its own very powerful sitemaps XML feature which can easily be enabled in the plugin settings. When the sitemap feature is enabled in the Yoast SEO plugin, it will disable the sitemaps feature from WordPress, which helps only have one sitemap output on your site. You can enable the sitemaps XML feature in Yoast SEO in wp-admin from:


    SEO > General


    Another very popular SEO plugin is Rank Math SEO which is also commonly used on sites.

    When the plugin has been installed and active on your site, you can access the sitemap feature from:


    Rank Math > Sitemap Settings


    You can follow this help article by using the sitemaps feature in the Rank Math SEO plugin.


    Using either the sitemaps XML feature in WordPress core or the sitemap features that are provided in the Yoast SEO or Rank Math SEO will make sure that your site has a correctly outputting sitemap.


    For 24-hour assistance any day of the year, contact our support team by email or through your Client Portal.

    Was this article helpful?

    Send feedback

    Can’t find what you’re looking for?

    Our award-winning customer care team is here for you.

    Contact Support