Skip to content
Happy New Year 2027 from ZenexCloud
ZenexCloud
Hosting

How do I set up a cron job in cPanel?

Schedule scripts to run automatically using cPanel Cron Jobs.

Cron jobs run commands on a schedule, for example to clear a cache or send emails.

  1. In cPanel, open Cron Jobs.
  2. Under Add New Cron Job, pick a Common Setting such as Once Per Hour, or set minute, hour, day, month and weekday yourself.
  3. Enter the command. Example for a PHP script:

/usr/local/bin/php /home/USERNAME/public_html/script.php

  1. Click Add New Cron Job.

Set an email for output Enter an email address at the top of the page to receive the output. Add >/dev/null 2>&1 at the end of the command to turn off messages.

WordPress By default WordPress runs its scheduled tasks when visitors load pages. For a reliable schedule:

  1. Add this line to wp-config.php: define('DISABLE_WP_CRON', true);
  2. Add a cron job every 5 to 15 minutes running: /usr/local/bin/php /home/USERNAME/public_html/wp-cron.php

Tips

  • Do not run a job every minute unless needed. It uses your resources. See "What are resource limits?".
  • Use full paths.
  • Check the exact PHP path on your server if the command fails.

Still need help?

Ask Zeni in the chat bubble, or open a support ticket. We answer 24/7.