Creating a cron job in cPanel
- Log in to cPanel.
- In the Advanced section, click Cron Jobs.
- Under Add New Cron Job, set the schedule. You can pick a common preset from the Common Settings dropdown (for example, “Once Per Day”) or set the five schedule fields manually:
- Minute (0-59)
- Hour (0-23)
- Day (1-31)
- Month (1-12)
- Weekday (0-6, Sunday = 0)
- In the Command field, enter the command to run.
- Click Add New Cron Job.
Example commands
Run a PHP script:Replace username with your cPanel username and adjust paths to match your account.
Email output
By default, cron sends any command output to your account’s email address. Set the email in the Cron Email section of the Cron Jobs page, or append> /dev/null 2>&1 to a command to silence its output.
Tips
- Don’t schedule jobs too frequently. Very frequent jobs (every minute) that run heavy scripts can consume your account’s resources. Choose the longest interval that meets your needs.
- Replace wp-cron with a real cron job. WordPress’s built-in wp-cron runs on page visits, which is unreliable on low-traffic sites and wasteful on busy ones. Disable it in wp-config.php with
define('DISABLE_WP_CRON', true);and schedule the wget command above every 10-15 minutes instead. - Use full paths in commands — cron runs with a minimal environment and may not find binaries otherwise.