A cron job runs a command automatically on a schedule. Use one to trigger WordPress tasks reliably, send scheduled emails, or run a maintenance script every night. cPanel provides a simple form for this.
Adding a Cron Job
- In cPanel, open Cron Jobs under the Advanced section.
- Optionally enter an email address to receive the output of each run.
- Under Add New Cron Job, choose a Common Settings preset, such as Once Per Day, or set the timing fields manually.
- Enter the command to run in the Command box.
- Click Add New Cron Job.
Understanding the Timing Fields
The five timing fields are minute, hour, day, month, and weekday. An asterisk means "every".
| Schedule | Fields |
|-------------------|-------------------|
| Every 15 minutes | */15 * * * * |
| Every day at 2am | 0 2 * * * |
| Every Monday 6am | 0 6 * * 1 |
Writing the Command
A common task is calling a WordPress cron handler with wget:
wget -q -O /dev/null "https://yourdomain.com/wp-cron.php?doing_wp_cron"
To run a PHP script directly, use the full path to PHP and the file:
/usr/local/bin/php /home/cpuser/public_html/task.php
Tips
- Do not schedule jobs more often than you need, as very frequent jobs add server load.
- Use the email field while testing so you can see errors, then remove it once stable.
- If a job does not run, check the command path is absolute and that the script has correct permissions.
For real WordPress sites, disabling the built-in pseudo-cron and using a real cron job makes scheduled tasks far more reliable.