When running WordPress Cron manually, it shows WP-Cron spawning is disabled. What is WP-Cron spawning?

What is WP-Cron spawning?

First off, let’s see what WP-Cron is and how it works:

  • WP-Cron is how WordPress handles scheduling time-based tasks in WordPress, e.g. checking for core updates and publishing scheduled post.

  • WP-Cron works by checking, on every page load, a list of scheduled tasks to see what needs to be run.

  • Any tasks due to run will be called during that page load.

    And at this point, a cron spawning might happen, whereby WP-Cron would send a request to run cron through HTTP request that does not halt page loading. And note that the request is sent to wp-cron.php, e.g. https://example.com/wp-cron.php.

So WP-Cron spawning is basically an automatic cron call that happens on page load. See _wp_cron() and spawn_cron().

Therefore, if you manually run WordPress cron, then you should disable the automatic cron call since it will contribute to extra resource usage on your server. See Hooking WP-Cron Into the System Task Scheduler.

And thus, there should be no need to worry regarding the message that says WP-Cron spawning is disabled — it is probably merely a notice/reminder, or that the plugin might simply be trying to make a test cron request, but then did not proceed when it noticed WP-Cron spawning is disabled.

Nonetheless, if the spawning is disabled, then ensure that WordPress cron is still being executed properly, e.g. via the cron daemon in Linux and MacOS systems.

can I enable it while using define('DISABLE_WP_CRON', true);

WP-Cron spawning is enabled by default, but it can be disabled/enabled via the DISABLE_WP_CRON constant:

  • Disables cron spawning — define('DISABLE_WP_CRON', true);
  • Enables cron spawning — define('DISABLE_WP_CRON', false);

However, if you have access to the system’s task scheduler (to make a web request to the wp-cron.php file), then you should just disable WP-Cron spawning.