Cron jobs run commands on a schedule, for example to clear a cache or send emails.
- In cPanel, open Cron Jobs.
- Under Add New Cron Job, pick a Common Setting such as Once Per Hour, or set minute, hour, day, month and weekday yourself.
- Enter the command. Example for a PHP script:
/usr/local/bin/php /home/USERNAME/public_html/script.php
- 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:
- Add this line to wp-config.php: define('DISABLE_WP_CRON', true);
- 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.