cron is a Linux utility which schedules a command or script on your server to run automatically at a specified time and date. A cron job is the scheduled task itself. Cron jobs can be very useful to automate repetitive tasks.
Scheduled tasks are necessary for this plug-in, and because WordPress has to work on all sorts of different platforms, OS’s, and configurations, it cannot assume that your host will natively provide support for a cronjob service that can handle scheduled tasks. This is why WordPress developers have created a workaround – the
wp-cron.php file in your main WordPress folder.
This script is executed every time someone loads a page. It then checks if there's a scheduled task to be done and executes it if necessary.
Cron settings depends on your hosting provider. In this documentation we use a cPanel-enabled hosting provider as an example scenario.
NOTE: This example is relevant to cPanel. If you are familiar with your server's shell, and your host allows native cron jobs, you can also do the same setup using the cron settings below.
Edit the file
/wp-config.php then add the following line:
Go to your host's cPanel, and look under Advanced > Cron jobs and add a new cron task:
wget -q -O - https://YOURDOMAIN.COM/wp-cron.php?doing_wp_cron=1 > /dev/null 2>&1
The Cron jobs tool has some of the most common schedules preset, so you can just select Every minute from the common settings or use “*” symbol in all the fields.
We suggest to install a plugin such as Advanced Cron Manager to check that the Cron Jobs are executed correctly.