Possible bug with Rankmath Sitemap

#954905
  • Saumya Majumder
    Rank Math free

    Hi,
    recently some of our customers have been having a weird and random issue with Rankmath sitemaps.
    Basically, the issue is that, when a user updates a post, the /post-sitemap.xml shows the post and correct last updated date.

    But when checking /sitemap_index.xml it shows the incorrect last updated date.

    The only solution to fix this is to go to /wp-admin/admin.php?page=rank-math-options-sitemap and then increase the “link per sitemap” and then decrease it again.

    That fixes the issue. I wonder if this issue is related to sitemap cache: https://rankmath.com/kb/filters-hooks-api-developer/#enable-disable-sitemap-cache – maybe the cache not clearing until the links per sitemap is updated.

    But still wanted to report this bug to you for further check. This doesn’t happen all the time. It happens randomly.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    We apologize for the issue you are facing with the Rank Math sitemaps. Thank you for raising this concern regarding the incorrect last updated date in the /sitemap_index.xml compared to the /post-sitemap.xml.

    It does sound like this could be related to sitemap caching, as you mentioned. The caching mechanism may not be clearing properly, which could lead to discrepancies in the last updated dates.

    To address this issue, you can try adding the following filter to your theme’s rank-math.php file to disable sitemap caching:

    add_filter( 'rank_math/sitemap/enable_caching', '__return_false' );

    This should help ensure that the sitemap is always generated fresh without relying on cached data.

    If the problem persists or if you notice any other patterns, please reply to this ticket, and a human agent from the Rank Math Support team will take over and assist you further.

    Thank you for your understanding, and we appreciate your feedback!

    Sources:
    Rank Math Sitemap Issues and Their Fixes » Rank Math

    This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.

    Saumya Majumder
    Rank Math free

    The problem with disabling caching for sitemap would be devastating for really large websites. As the performance would be bad and the load times would be higher. The goal of this ticket is for the engineering team to look at this bug and figure out why the cache is not getting cleared properly in some random cases – causing this.

    Hello,

    The transients cache for sitemaps is designed to clear automatically whenever a new post or page is published or updated. Based on the behavior you described, it’s unlikely to be a bug in Rank Math. Instead, it’s more likely caused by a caching plugin or server-side caching setup interfering with the sitemap update process.

    To resolve this, we recommend excluding the sitemap files from caching: https://rankmath.com/kb/exclude-sitemaps-from-caching/

    Don’t hesitate to let us know if you need our assistance with anything else.

    Saumya Majumder
    Rank Math free

    Hi,
    I can confirm that this is not a server-side caching issue as all the sitemap pages are excluded from any server-level caching. Sorry for the delayed reply as I was away for a few days.

    I’ve asked your team to check only after doing a through analysis of the problem and confirming that no other parameter causing this problem. That is why changing the settings (as mentioned before) fixes the problem as it forces rankmath cache purge. The issue is with rankmath cache purge system which is not purging in some random cases.

    Hello,

    Since we can not replicate this issue, a plugin or theme conflict could also be the culprit.

    In that case, it is best to rule out a conflict by conducting a conflict check. You can follow this guide: https://rankmath.com/kb/check-plugin-conflicts/

    If the issue persists we might need to take a closer look at one of the sites where this issue occurs so we can troubleshoot further.

    Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this ticket.