Option to take over wp-cron.php

Daniel Weaver shared this idea 1 month ago
Open Discussion

Sometimes on heavier sites or where consistency is desired it is preferable to have wp-cron be run by an actual cron job and disable WP's default of running inside a normal site request.  Other panels have the ability to check a box to "take over wp-cron" which automatically creates the cron job and disables WP's cron by adding define('DISABLE_WP_CRON', true) ; to the wp-config.php

It is worth noting a lot of methods online of setting up the cron job do not do so in a performant way.  Most guides recommend doing the following:

wget -q -O - https://domain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

But this still makes an external request taking up a PHP FPM process, etc.  Instead since wp-cli is installed you can do:

wp cron event run --due-now

Which will run all the events that need to be run.

1 votes

Comments (0)

Leave a Comment