How to Add a Cron Job in cPanel

Estimated reading: 2 minutes

Overview

A cron job is a scheduled task that runs automatically at set intervals on your server. They are commonly used to send scheduled emails, run backups, clear caches, update data feeds, or trigger WordPress scheduled events. cPanel has a built-in Cron Jobs tool that makes this easy to set up without touching the command line.

How to Add a Cron Job

  1. Log in to your cPanel account.
  2. In the Advanced section, click Cron Jobs.
  3. Under Add New Cron Job, choose how often you want it to run using the Common Settings dropdown (e.g., Once Per Day, Once Per Hour).
  4. In the Command field, enter the command to run.
  5. Click Add New Cron Job to save.

Common Cron Job Examples

TaskCommand
Trigger WordPress WP-Cron manuallyphp /home/username/public_html/wp-cron.php
Run a PHP scriptphp /home/username/public_html/myscript.php
Run a Bash script/bin/bash /home/username/scripts/backup.sh
Fetch a URL (triggers an action)curl -s https://yourdomain.com/cron-trigger.php

Replace username with your actual cPanel username.

Understanding the Cron Schedule Fields

If you need a custom schedule beyond the presets, you can enter values directly. The five fields from left to right are:

FieldMeaningAllowed values
MinuteMinute of the hour0–59
HourHour of the day0–23
DayDay of the month1–31
MonthMonth of the year1–12
WeekdayDay of the week (0 = Sunday)0–6

Use * for “every”. For example, 0 */6 * * * means every 6 hours.

WordPress and Cron Jobs

WordPress has its own scheduling system called WP-Cron, but it only fires when someone visits your website. On low-traffic sites, this can cause scheduled posts, backups, or plugin tasks to be delayed. The fix is to:

  1. Disable WP-Cron in wp-config.php by adding: define('DISABLE_WP_CRON', true);
  2. Add a real cron job in cPanel to call wp-cron.php every 15 minutes.

How to Edit or Delete a Cron Job

  • To edit an existing cron job, scroll to Current Cron Jobs and click Edit next to the one you want to change.
  • To delete a cron job, click the Delete button next to it. This stops it immediately.

Need help setting up a cron job? Contact our support team.