Each time a user runs your WordPress application by visiting it, or viewing posts/blogs WordPress goes to work to see if there are any jobs open to run them.

For a starting or smaller WordPress website this is no problem, but it is not optimized at all: let's change this.

First, we will need to tell WordPress that we don't want the users to be responsible to check if there are jobs open to be processed. (What we explained above)

We do so by adding this line of code to the wp-config.php file:

define('DISABLE_WP_CRON', true);

Now add your own cronjob to execute the WordPress cron script to run so about every 5 or 10 minutes, this should be enough (if it's not, then lower it):

php /home/ploi/{domain}/public/wp-cron.php

Make sure to replace {domain} it with your own domain as it displays in your site overview.

That's it, your WordPress installation will now make sure your users are not responsible for executing the WordPress cron/jobs.

09 December 2018 (last updated 2 years ago)

16637 views

Written by Dennis Smink

Dennis brings over 6 years of hands-on experience in server management, specializing in optimizing web services for scalability and security.

Back to Optimisations


Start free trial