Rank Math sitemap_generate breaks WP Cron (and wp-cli)

#144535
  • Resolved Sami Lempinen
    Rank Math free

    I have been troubleshooting a customer site due to WP Cron events being missed, and it turns out running “wp cron test” results in

    Error: Callable ["\\RankMath\\CLI\\Commands","sitemap_generate"] does not exist, and cannot be registered as 'wp rankmath sitemap generate'.

    Rank Math is at 1.0.56.1.

    In fact, trying to execute any wp-cli command fails with this fatal error. We had to disable Rank Math to enable wp-cron (which in our environment is run via wp-cli).

Viewing 7 replies - 1 through 7 (of 7 total)
  • Danial
    Rank Math business

    Hello,

    Thank you for contacting Rank Math, and sorry for any inconvenience that might have been caused due to that.

    Unfortunately, at the moment, Rank Math does not support the use of WP-CLI. You can only use the interface.

    I hope this helps you with your issue.

    Thanks Danial.

    It’s not that I would need Rank Math to support wp-cli, but Rank Math *breaks* wp-cli by trying to register a wp-cli command (rank-math.php line 389):

    WP_CLI::add_command( 'rankmath sitemap generate', [ '\RankMath\CLI\Commands', 'sitemap_generate' ] );

    Commenting out this line restores wp-cli operation.

    Any further comment?

    I removed the offending line from the Rank Math code, and wp-cli was re-enabled. This is on PHP 8.

    Hello,

    We were able to reproduce the error and have logged it. Please allow us some time to test and release a fix.

    For now, please keep line 392 in the rank-math.php file commented.

    We’ll add a fix for this in the upcoming update.

    In the meantime, if you need any other assistance, please feel free to let us know. We are here to help.

    Thank you.

    Thanks for the update. Looking forward to the fix.

    Hello,

    We have identified the issue and fixed it in our internal development version. The patch will be included in the next update.

    Please keep an eye on the updates and let us know if the issue persists after updating the plugin on your site.

    Thank you.

    Hello,

    Appreciate your patience.

    We have released a new update. You can check the changelog here:
    https://rankmath.com/changelog/

    Your issue should be fixed.

    If not, please let us know so we can assist you further.

    Thank you.

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

You must be logged in to reply to this ticket.