Cron jobs (scheduled tasks) Print

  • 0

A cron job runs a command on a schedule, such as a script that sends reminder emails every hour or clears a cache overnight. Most sites never need one; WordPress has its own built-in scheduler. Add one only if a plugin or developer has asked you to.

Open Advanced Features → Cron Jobs and click Create Cron Job. Set the schedule in the five boxes: Minute, Hour, Day of Month, Month and Day of Week. A star means "every", so a star in every box runs the command every minute; the line Cron job will run under the boxes spells out the schedule in words as you type, so check it reads the way you intend. Some common schedules:

Schedule Minute Hour Day of Month Month Day of Week
Every 15 minutes */15 * * * *
Every hour, on the hour 0 * * * *
Daily at 3:30 am 30 3 * * *
Every Monday at 6 am 0 6 * * 1

Type the command in the Command box. The page shows sample commands with your own paths filled in; the two useful patterns are running a PHP file directly, for example php /home/username/domains/your-domain/public_html/script.php, or fetching a web address, for example curl --silent https://your-domain/cron.php > /dev/null. Tick Prevent E-mail unless you want an email every time the job runs, then click Create.

Existing jobs are listed on the Cron Jobs page, where you can edit or delete them. Please keep schedules sensible: a job every minute that does real work can slow your site and everyone else's.

If you have any trouble, raise a ticket and we will sort it out.


Was this answer helpful?

« Back