Sitemap does not update
The Yoast plugins create sitemaps on the fly. This means sitemaps are updated automatically when you add, edit, or delete content. Therefore, there is no need to generate or rebuild the sitemaps in most cases. However, if you have modified content or added developer filters, you may need to force an update.
Sometimes the cache functionality on your site prevents the sitemaps from updating automatically. The cache can be handled through a lot of methods so you may not have intentionally added a cache feature but it’s there nonetheless.
WordPress integrated cache
Firstly, this problem could be caused by WordPress integrated cache. If you have installed a cache plugin like W3 Total Cache or WP Super Cache, please check your settings and exclude the sitemaps from being cached. Not sure how to do that? Please contact the support team for your cache plugin or visit our guide here for common caching plugins.
Look in your WordPress admin dashboard. Do you see a flush cache button? Some non-cache plugins or WordPress themes include a cache feature. Run a conflict check to locate what plugin or theme feature adds the cache button. If a plugin or theme is not adding a cache, some web hosts like GoDaddy and WP Engine include caching on their hosting plans. Please contact the support team for the plugin, theme, or web host that includes the cache feature.
Server-level cache
Secondly, the problem could be caused by server-level cache. Check your HTTP headers for cache-related output. Here is a great free tool and below are examples of cached and non-cache domains. If you see the term cache, it is enabled somewhere. If you have not specifically set this up, please contact your web host for assistance tracking it down.
As of Yoast SEO version 9.0, the cache is disabled by default. If you are using an older version and need to disable the sitemap cache, please use the code snippet below.
/* Disable Yoast SEO sitemap caching
* Credit: Yoast development team
*********
* Please note that changes will be applied upon next sitemap update.
* To manually flush sitemap cache, please disable and enable the sitemap feature afterwards.
*/
add_filter('wpseo_enable_xml_sitemap_transient_caching', '__return_false');
To enable sitemap caching, please use the code snippet below.
/* Enable Yoast SEO sitemap caching
* Last Tested: Mar 27 2019 using Yoast SEO 10.0.1 on WordPress 5.1.1
* Credit: Yoast development team
*********
* Please note that changes will be applied upon next sitemap update.
* To manually create the cached sitemap, please disable and enable the sitemaps then load each sitemap.
* Once cached, Yoast SEO will update sitemap cache as needed.
*/
add_filter('wpseo_enable_xml_sitemap_transient_caching', '__return_true');
Manual sitemap update
If you want to do a manual sitemap update, please disable the sitemap feature, clear the cache, and enable the sitemap feature to force the sitemap to rebuild.