Skip to main content
A cron job is a scheduled task that runs automatically at defined intervals. Common uses include running maintenance scripts, sending queued emails, processing imports, and triggering application schedulers (such as WordPress’s wp-cron or Laravel’s scheduler).

Creating a cron job in cPanel

  1. Log in to cPanel.
  2. In the Advanced section, click Cron Jobs.
image
  1. 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)
  2. In the Command field, enter the command to run.
  3. Click Add New Cron Job.

Example commands

Run a PHP script:
Fetch a URL (for example, to trigger wp-cron):
Run a script and discard all output:
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.
If you need help setting up a cron job, contact our support team.