Disabling wp-cron.php for better performance
WordPress runs scheduled tasks through the wp-cron.php file, and it does so on every visit to your website. On a small website you will hardly notice this, but with many visitors the file is called very often and your website can slow down. You therefore switch off this call on every visit and let a cron job run the tasks at fixed times instead.
Enter a domain name, such as yourdomain.nl.
This value doesn’t fit here. An example: whs1.
Web Hosting (DirectAdmin)
Also for Reseller Hosting.
Note: a mistake in wp-config.php can make your website unreachable. First make a copy of the file or create your own backup.
- Open the
wp-config.phpfile in the folder of your WordPress website, for example via File Manager in DirectAdmin (see Managing files). If WordPress is in the root of your domain, that isdomains/yourdomain.nl/public_html/wp-config.php. - Directly before the line
/* That's all, stop editing! Happy publishing. */, add the linedefine('DISABLE_WP_CRON', true);. - Save the file.
- In DirectAdmin, create a cron job that runs every 15 minutes (
*/15for the minute,*for the other fields), with this command:wget -q -O - "https://yourdomain.nl/wp-cron.php?doing_wp_cron" >/dev/null 2>&1. If WordPress is in a folder, add that folder to the address:https://yourdomain.nl/<folder>/wp-cron.php?doing_wp_cron. How to create a cron job is explained in Setting up a cron job on your hosting package.
WordPress Hosting (Plesk)
- Log in to Plesk at
https://whs1.srvnl.nl:8443. You can find your server name in How can I find the server name of my hosting package? - Click WordPress in the menu on the left.
- For your website, under Performance, switch on Take over wp-cron.php.
WP Toolkit then creates a scheduled task of its own that runs wp-cron.php every 5 minutes. You can see that task under Websites & Domains › Scheduled Tasks. You do not need to change wp-config.php yourself here.
wp-cron.php then no longer runs on every visit, but as a scheduled task in the background.
Related articles
Thank you for your feedback.

