Hurry! Sale Alert: Inwebify's Premium WordPress Hosting!
* Valid for new purchases, on select plans only
Hurry! Sale Alert: Inwebify's Premium WordPress Hosting!
* Valid for new purchases, on select plans only
This article describes how to configure a virtual to real cron job for WordPress.
Cron is a utility that allows you to set up scheduled tasks on a web server. The WordPress cron system is called WP-Cron, and it simulates the UNIX cron job so you can automate update checks, scheduled posts, and other repetitive tasks.
WordPress does not use a real cron job for scheduling and other related tasks by default. Instead, when a page is loaded on a WordPress site, WordPress runs the wp-cron.php file. Although this “virtual” cron job is convenient, it has some disadvantages:
To resolve these issues, you can disable the default virtual WordPress cron job and set up a real cron job. To do this, follow these steps:
The wp-config.php file is located in the directory where you installed WordPress. Usually, this is the public_html directory.
define(‘DISABLE_WP_CRON’, true);
After you have disabled the default WordPress cron configuration in the wp-config.php file, you are ready to set up a real cron job that runs at fixed intervals regardless of site traffic.
To set up a WordPress cron job using cPanel, follow these steps:
If you do not want to receive e-mail notifications for the cron job, you can append >/dev/null 2>&1 to the command, which redirects all output to /dev/null.
You can run cron jobs a maximum of every 15 minutes on shared accounts. A 30-minute interval for the WordPress cron job should be more than sufficient.
wget -q -O – https://domain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Enabling external cron jobs will reduce resource usage, improve performance, and run jobs more reliably an