Articles on: ​Onyx Documentation

How to disable the WordPress CRON job and set it up in Onyx

WordPress doesn’t have a built-in scheduler to run regular tasks, so to get around this it fires off a request to process wp-cron.php every time a visitor requests a page.

There are a couple of issues with this, firstly on busy sites this means this cron task will be running all the time - when it really doesn’t need to.

On a small website with a few pages and a few hundred visitors a day wp-cron.php isn't a problem, but imagine a larger website with maybe a 100 visitors an hour. If each visitor reads your home page, and 2 others, that would mean that wp-cron.php is being called 300 times an hour, 7200 times a day. Plus, on a busy/large website wp-cron.php might take a few minutes to run.
Multiple copies of wp-cron.php can be started at once as well, because people don't wait in line to view your web pages! This means that more memory is needlessly consumed. It all snowballs into a horrible resource hog.
We've seen some busy sites running multiple instances of wp-cron.php tasks consuming over 200Mb of virtual memory each - not an efficient use of resources.
This flip side though can be just as problematic - if your site is well optimised and most of the page requests are being served from cache the request to process wp-cron.php may not happen as often as you’d like.

There is a solution, in both these cases - disable the WordPress CRON and setup a Onyx CRON job on a schedule you control.

Both disabling the WordPress Internal CRON and setting up an Onyx CRON can be done via the Cron jobs option



Disable the WordPress Internal CRON and setup the replacement Onyx CRON



Click the Disable WordPress Internal Cron button.



Once it completes, you'll see a banner with a click here link to set up the replacement Onyx CRON.



Click the click here link.

You'll see the New Cron job screen with the command to execute pre-filled as WordPress Internal Cron.



You have some pre-sets you can select for the schedule by clicking the Hourly, Daily, Weekly and Monthly buttons.

How frequently you configure the WordPress Cron to run is site dependant - if you're running a busy shopping site you may want it to run every 5 minutes to process orders. Whereas if you just have a nightly backup scheduled you could run the Cron once a day to trigger the backup.

You can manually enter each field:

Minute: 0 - 59

Hour: 0 - 23

Day of month: 1 - 31

Month: 1 - 12

Day of week: 0 - 6 (Sunday to Saturday)

in any field means Every (minute, hour, day of month, month, day of week)

Once you've configured your desired schedule click Create Cron Job.

*

*

Updated on: 24/01/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!