Cron job

WordPress has something called wp-cron. If you haven’t read about it, its fine. But please be aware that you cannot live without it!

Wordpress run cron jobs when a user browse the website, for better performance, this behaviour is disabled.

Setup a real cronjob

From your Linux terminal, first open crontab:

crontab -e

Then add a line like below in it.

*/10 * * * * curl https://example.com/edition/wp-cron.php?doing_wp_cron > /dev/null 2>&1

or better

*/10 * * * * php /var/www/example.com/htdocs/public/edition/wp-cron.php?doing_wp_cron > /dev/null 2>&1

Please make sure you use correct path to wp-cron.php

Above will run wp-cron every 10 minutes. You can change */10 to */5 to make it run every 5 minute

Last updated