How to Fix Yoast SEO Sitemap Not Updating

How to Fix Yoast SEO Sitemap Not Updating

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.

  1. Log in to your WordPress dashboard, then open the menuYoast SEO > Settings
    Cara Mengatasi Sitemap Yoast SEO Tidak Update - 1-1
  2. Scroll down and look for the optionSitemap, turn off the feature, and then click the save changes button
    Cara Mengatasi Sitemap Yoast SEO Tidak Update - 1-2
  3. After the sitemap feature is turned off, reload your settings page and turn the Sitemap feature back on.
    Cara Mengatasi Sitemap Yoast SEO Tidak Update - 1-3

2. Disabling the Sitemap Cache Feature via cPanel

  1. Log in to your cPanel, then find and open the File Manager page
    Cara Mengatasi Sitemap Yoast SEO Tidak Update - 2-1
  2. In the file manager, open your WordPress installation folder, which is usually inside thepublic_html
    Cara Mengatasi Sitemap Yoast SEO Tidak Update - 2-2
  3. folder. Find and open your theme installation folder, which is located at/wp-content/themes/theme-name
    Cara Mengatasi Sitemap Yoast SEO Tidak Update - 2-3
  4. Inside the active theme folder, find and edit thefunctions.php
    Cara Mengatasi Sitemap Yoast SEO Tidak Update - 2-4
  5. 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

  1. Log in to your WordPress dashboard, then open the menu Appearance > Theme File Editor
    Cara Mengatasi Sitemap Yoast SEO Tidak Update - 3-1
  2. If a pop-up appears saying Heads up!, click the I understand.
    Cara Mengatasi Sitemap Yoast SEO Tidak Update - 3-2
  3. button. Find and click Theme Functions to add the code.
    Cara Mengatasi Sitemap Yoast SEO Tidak Update - 3-3
  4. Inside Theme Functions, add the code below to the very last line, then click the Update File
    Cara Mengatasi Sitemap Yoast SEO Tidak Update - 3-4
/* 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');

Written by

Muhammad Khoirun Nasikin

I enjoy tinkering with WordPress, hosting, VPS, web development, and various small experiments related to websites. I have over 3 years of experience in the web hosting industry.

COMMENTS

Loading...