How to disable WP-Cron and set up a cron job in cPanel Print

  • 0

WordPress normally runs scheduled tasks (WP-Cron) when someone visits the site. On busy sites this wastes resources; on quiet sites tasks may run late. A real server cron job is more reliable.

Step 1: Disable WP-Cron

Edit wp-config.php and add above /* That's all, stop editing! */:

define( 'DISABLE_WP_CRON', true );

Step 2: Add a cron job

  1. In cPanel, open Cron Jobs in the Advanced section.
  2. Under Common Settings, choose Once Per Fifteen Minutes (or every 5 minutes for shops).
  3. In Command, enter (replacing the path with your own):
cd /home/cpuser/public_html && php wp-cron.php >/dev/null 2>&1
  1. Click Add New Cron Job.

Using php directly avoids web requests and firewall issues. Your home path is shown in cPanel's General Information panel.


Was this answer helpful?

« Back