If you ever wondered if there is a need to clean out your WordPress crons, you’d be correct. Sometimes, WordPress crons are leftover from previous plugins due to several situations. But how do you clean them out? You can go one by one and figure out which cron belongs to which plugin, or you could use an interesting trick to delete them all and re-create the crons for the plugins you have active on your site.
This process was provided by Gulshan Kumar, and you can visit his site below.
As time passes, it is not uncommon for your WordPress database to accumulate a significant number of orphaned cron jobs, often resulting from the use of plugins and themes in the past.
In order to address this issue, you can use the following commands via WP CLI:
# First off, backup Database
wp db export
# List all of them
wp cron event list
# Delete all at once
wp option delete cron
# Reset entries of cron jobs
wp plugin deactivate –all
wp plugin activate –all
Gulshan provided this update.
Jordan Scheduled post need to be updated once. Else, it can miss.
Quick fix: Select all scheduled post > ( Bulk action > Edit ) > click Update.