How to set up cron jobs in cPanel
Schedule automated tasks using cPanel Cron Jobs. Run PHP scripts, WordPress wp-cron, shell commands, and backup scripts on a recurring schedule.
On this page
A cron job is a scheduled command that runs automatically at set intervals. Common uses include sending scheduled emails, clearing cache, running database maintenance, and triggering WordPress scheduled tasks.
Adding a cron job in cPanel
- Log in to cPanel
- Search for Cron Jobs or find it under Advanced
- Set the schedule using the dropdowns (minute, hour, day, month, weekday) or enter cron syntax directly
- In the Command field, enter the command to run
- Click Add New Cron Job
To receive an email output each time the job runs, set your email in the Cron Email field at the top of the page. Set it to blank or redirect to /dev/null to suppress emails.
Cron schedule syntax
A cron schedule has five fields: minute hour day month weekday
| Schedule | Cron expression |
|---|---|
| Every 5 minutes | */5 * * * * |
| Every hour | 0 * * * * |
| Every day at midnight | 0 0 * * * |
| Every Monday at 3am | 0 3 * * 1 |
| First of every month | 0 0 1 * * |
WordPress cron
WordPress has a built-in scheduling system (WP-Cron) that runs when someone visits your site. For sites with low traffic, scheduled tasks may be delayed. Replace WP-Cron with a real cron job:
- Add this line to your
wp-config.php:define('DISABLE_WP_CRON', true); - Add a cron job in cPanel with the command:
/usr/local/bin/php /home/cpusername/public_html/wp-cron.php - Set the schedule to
*/15 * * * *(every 15 minutes is usually sufficient)
The PHP binary path may differ by server. Try /usr/local/bin/php first. If the cron does not run, open a support ticket and ask for the correct PHP CLI path for your server.
Troubleshooting
- Job doesn't run-verify the command path is absolute (starts with
/). Relative paths don't work in cron. - Permission denied-the script must be executable:
chmod +x /path/to/script.sh - No output / email-ensure the cron email is set, or redirect output: append
>> /tmp/cron-output.log 2>&1to the command and check the log file - Resource usage spikes-avoid running heavy scripts too frequently; see resource limits
Related: Shared hosting overview | Resource limits | Softaculous guide | How to contact UnderHost support
Need shared hosting?
Choose an UnderHost shared hosting plan with cPanel, email, SSL, DNS tools, and 24/7 support.





















