cPanel & Hosting How-Tos How to Set Up a Cron Job in cPanel
A cron job runs a task automatically on a schedule — every few minutes, nightly, weekly, whatever you set. It’s how you automate backups, reports, maintenance scripts and a CMS’s scheduled work. Here’s how to create one in cPanel.
Step 1: Open Cron Jobs
In cPanel, open Cron Jobs (under Advanced).
Step 2: Set the schedule
A cron schedule has five time fields: minute, hour, day of month, month, day of week. cPanel gives you Common Settings dropdowns so you don’t have to memorize the syntax — pick one like “Once Per Day” or “Every 15 Minutes”.
If you set it manually, the fields read left to right. For example:
0 2 * * *— every day at 2:00 AM.*/15 * * * *— every 15 minutes.0 0 * * 0— every Sunday at midnight.
An asterisk * means “every”.
Step 3: Enter the command
The command is what runs. A few common forms:
- Run a PHP script:
/usr/local/bin/php /home/USER/public_html/script.php - Fetch a URL quietly:
wget -q -O /dev/null https://yourdomain.com/task.php
Use the full path to your script, and the correct PHP binary where needed (support can confirm the path for your server).
Step 4: Save and check it
Click Add New Cron Job. To confirm it’s working:
- Set cron to email you its output (there’s a field for a notification email), so you see any errors.
- Check that the task actually did its job after the scheduled time.
WordPress: use a real cron
WordPress’s built-in scheduler (WP-Cron) only fires when someone visits your site, so scheduled posts and tasks can be late on a quiet site. For reliability:
- In
wp-config.php, add:define('DISABLE_WP_CRON', true); - Add a cPanel cron job that runs every 15 minutes:
wget -q -O /dev/null https://yourdomain.com/wp-cron.php
Now WordPress tasks run on a dependable schedule.
Common mistakes
- Wrong path to the script or to PHP — double-check both.
- Running too often — a heavy script every minute can strain resources; use the longest interval that works.
- No output check — always have cron email you while testing.
Automation on reliable hosting
Cron jobs are available on every Web Hosting and WordPress Hosting plan. If a scheduled task is resource-heavy and starts affecting your site, a Managed VPS gives it dedicated CPU and memory to run without impacting your pages.
Frequently asked questions
What is a cron job?
A cron job is a scheduled task that runs automatically at a time you set - every minute, hourly, daily, weekly and so on. It is used to run scripts like backups, report generation, or a CMS's scheduled tasks without anyone pressing a button.
How do I run WordPress cron reliably?
WordPress's built-in cron only runs when someone visits the site. For reliability, disable WP-Cron in wp-config.php and add a real cron job in cPanel that calls wp-cron.php on a schedule, for example every 15 minutes.
Why is my cron job not running?
Common causes are a wrong path to the script, missing the correct PHP binary, or a typo in the schedule. Check the command path, use the full path to PHP where needed, and have cron email you its output so you can see errors.