A cron job runs a command or script automatically at set times, for example a daily report, a nightly clean-up or an application's scheduled tasks.
Creating a cron job
- In cPanel, open Advanced › Cron Jobs.
- Under Add New Cron Job, choose a timing from Common Settings, or fill in the minute, hour, day, month and weekday fields.
- Enter the command and click Add New Cron Job.
Example commands
| Purpose | Command |
|---|---|
| Run a PHP script | /opt/cpanel/ea-php84/root/usr/bin/php /home/USERNAME/public_html/script.php |
| Call a web address | curl -s https://yourdomain.com/cron.php >/dev/null |
| Run WordPress scheduled tasks | cd /home/USERNAME/public_html && /opt/cpanel/ea-php84/root/usr/bin/php -q wp-cron.php |
Replace USERNAME with your cPanel username, shown on the right of the cPanel home page.
Good practice
- Do not run jobs more often than needed. Every 15 minutes is enough for almost all websites.
- Add
>/dev/null 2>&1at the end of a command if you do not want an email every time it runs. - Enter your email address under Cron Email to receive any error output.
WordPress: on sites moved during the November 2026 upgrade, WordPress scheduled tasks already run from the server every 15 minutes. You do not need to add a cron job for them.