Skip to main content

Setting up a cron job

Updated May 21, 2026

A cron job is a task your server runs on a schedule. WordPress, Laravel and many apps need a cron to run background work.

Create one

  1. cPanel → Cron Jobs.
  2. Pick a common schedule from the dropdown (e.g. Once Per Five Minutes) or use the five fields directly.
  3. Enter the command. Examples:
    • WordPress: cd ~/public_html && /usr/local/bin/php wp-cron.php >/dev/null 2>&1
    • Laravel scheduler: cd ~/public_html && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1
  4. Click Add New Cron Job.

Tips

  • Don't run anything more often than once a minute — most shared servers will throttle you.
  • Always redirect output (>/dev/null 2>&1) unless you want an email every run.
  • Use the absolute path to PHP (/usr/local/bin/php) — bare php may not work.

Was this article helpful?