Wordpress - Is there a quick way to view the wp-cron schedule
Why don't you just create a cron job, make a database dump and look where the info about the cron job is kept? That's what I did. As suspected, WordPress 3.5.1 keeps its cron jobs in the {wp}_options
table under the name 'cron'
.
SELECT *
FROM `wp_options`
WHERE `option_name` LIKE '%cron%'
Or through functions.php:
$cron_jobs = get_option( 'cron' );
var_dump($cron_jobs);
WordPress has an undocumented function, _get_cron_array()
, that returns an array of all currently scheduled tasks. We are going to use a crude but effective method to dump out all the tasks using var_dump()
. For ease of use place the following code in the plugin:
echo '<pre>';
print_r( _get_cron_array() );
echo '</pre>';
For more info: https://developer.wordpress.org/plugins/cron/simple-testing/
You can use the WP-CLI.
From the command line, you can run the following command from the directory of your WordPress installation:
wp cron event list
It will display a table of the scheduled events, when it's set to run, and how often it's rescheduled.
Here is what was returned to me when I ran the command:
https://kinsta.com/knowledgebase/wordpress-cron-job/