If you use a caching plugin, or if your server implements server-level caching, there may be instances where your Yoast SEO sitemap does not update.
To resolve this, you can exclude the sitemap page from the cache, which is typically an option in WordPress caching plugins.
However, if you are not using a caching plugin, you can follow these steps to fix a Yoast SEO sitemap that is not updating.
What You Need Before Fixing a Yoast SEO Sitemap That Is Not Updating
- A website using the WordPress CMS
- The Yoast SEO plugin must be active
- Basic WordPress file editing skills (via cPanel or a file manager plugin, we will use cPanel here)
How to Fix Yoast SEO Sitemap Not Updating
1. Manually Flush the Sitemap Cache
This method is not highly recommended because you need to perform a manual flush every time you add a new article or content. It may be more appropriate if your website sitemap does not update very often.
- Log in to your WordPress dashboard, then open the menuYoast SEO > Settings
- Scroll down and look for the optionSitemap, turn off the feature, and then click the save changes button
- After the sitemap feature is turned off, reload your settings page and turn the Sitemap feature back on.
2. Disabling the Sitemap Cache Feature via cPanel
- Log in to your cPanel, then find and open the File Manager page
- In the file manager, open your WordPress installation folder, which is usually inside thepublic_html
- folder. Find and open your theme installation folder, which is located at/wp-content/themes/theme-name
- Inside the active theme folder, find and edit thefunctions.php
- file. Add the following code to the very bottom of thefunctions.phpfile, then save it
/* 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');3. Disabling the Sitemap Feature via WP Admin
- Log in to your WordPress dashboard, then open the menu Appearance > Theme File Editor
- If a pop-up appears saying Heads up!, click the I understand.
- button. Find and click Theme Functions to add the code.
- Inside Theme Functions, add the code below to the very last line, then click the Update File
/* 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');
COMMENTS
Loading...