14.1. Checking if CRON jobs work and fixing CRON problems
The plugin requires WP-Cron to be enabled and functioning as it should (See: Requirements). To find out if there is a problem with WP-Cron and fix it, do the following:
- Make sure you enabled scheduling, recrawling or deleting using the settings under Scheduling Tab of General Settings Page
- Go to Dashboard Page
- In What’s Happening Section, there is a table showing
CRON Events
, as it is shown in Fig. 8.2. Go to this table. - Check out the times shown in
Next
row of the table. For the events that are currently active, the times should point to the future. In other words, the times should look likex minutes later
, notx minutes ago
or-
. If the times never point to the future, then there is a problem with CRON jobs. Go on with the following items. Otherwise, there is no problem with CRON jobs. You do not have to read the next items. - Try to save the general settings (See: General Settings Page) of the plugin again, by making sure scheduling settings are enabled. When the settings are saved, the plugin will register the CRON events to WordPress again. After saving the settings, check out next run times of CRON events in What’s Happening Section. If the next event times point to the future, the problem is fixed. You do not have to read the next items. Otherwise, go on with the following items.
- In the sidebar of the admin panel, click
Tools > Site Health
. After the tests are finished, if you see a message similar toScheduled events are not running
orScheduled event has failed
, then there are definitely problems with WP-Cron. Alternatively, you can install WP Crontrol and then, in the admin panel’s sidebar, clickTools > Cron Events
. If you see an error message at the top of that page, then there is a problem with WP-Cron. If there is a problem with WP-Cron, keep reading. - WP-Cron might have been disabled in your WordPress installation’s
wp-config.php
file. You can find out whether WP-Cron is disabled or not by following the instructions given in Editing wp-config.php documentation. If WP-Cron is disabled inwp-config.php
, enable it by removingdefine( 'DISABLE_WP_CRON', true );
line or changing that line intodefine( 'DISABLE_WP_CRON', false );
. Otherwise, keep reading. - The cause of the problem is most likely that your hosting provider has disabled WP-Cron. You can contact your hosting provider and ask them to fix the problem for you. If the hosting provider said that the problem was not related to them and WP-Cron was enabled in your site, keep reading.
- The problem is most likely caused by another plugin or theme. One at a time, you can disable
your plugins and activate one of the official WordPress themes. After each deactivation,
save the general settings of the plugin so that the CRON events are registered again and then
check the next event times in
CRON Events
table under What’s Happening Section of Dashboard Page. If the next event times point to the future, then the problem was caused by the last theme/plugin you deactivated and the problem is fixed. Otherwise, keep repeating this process until you find the problematic theme/plugin.