Skip to content

Replacing WP-Cron with system cron on cPanel for WordPress

Replace WP-Cron with a real cPanel cron job so scheduled posts, order emails and plugin tasks run on time even when nobody is visiting your WordPress site. It takes one line in wp-config.php and one cron entry.

Scheduled posts that go out hours late, or WooCommerce emails that wait for the next visitor, usually mean WP-Cron is in charge of timing on your cPanel site. WP-Cron is the scheduler built into WordPress, and it only checks for due tasks when someone loads a page. On a quiet site that can mean hours of delay, and on a busy one the same check rides along with every request. The fix is to switch off the page-load trigger with DISABLE_WP_CRON in wp-config.php, then let a cPanel cron job run wp-cron.php every five minutes, or every minute on a busy WooCommerce store.

What’s happening

By default, WordPress sets up its scheduler in wp-cron.php and triggers it via a self-request from each page load. The page load returns; the cron processing continues in the background. Three failure modes: low-traffic sites where nothing fires for hours, high-traffic sites where the same job is triggered concurrently by multiple workers and conflicts, and sites where the cron job itself crashes and takes down the originating request. Switching to a system cron entry runs wp-cron.php on a fixed interval regardless of visitors.

How to verify

wp config get DISABLE_WP_CRON 2>/dev/null
wp cron event list
crontab -l | grep cron.php

wp cron event list shows what’s scheduled. If you see hundreds of entries, especially from WooCommerce’s Action Scheduler or a backup plugin, WP-Cron is doing more than the default and switching to system cron matters more.

The fix

  1. Disable WP-Cron. In wp-config.php, above the “stop editing” line:

    define( 'DISABLE_WP_CRON', true );

    Save. WordPress will stop self-triggering. Anything in the queue won’t run until something else fires the URL.

  2. Add a cPanel cron entry. cPanel > Cron Jobs. Set Common Settings to “Every 5 Minutes” (or 1 minute for WooCommerce-heavy sites). Command:

    /usr/local/bin/php /home/cpaneluser/public_html/wp-cron.php > /dev/null 2>&1

    Use the account’s selected PHP version, not the system default. On a MultiPHP cPanel host with PHP 8.2 selected for the account, the path is typically /opt/cpanel/ea-php82/root/usr/bin/php. Find it with which php from inside the cPanel user shell.

  3. For sites where calling wp-cron.php via HTTP is preferable (cleaner separation, runs through the full HTTP stack), use:

    wget -q -O - https://example.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1

    This requires the site to be reachable from the cron host. On a single cPanel server, that’s always true.

  4. Frequency by workload:

    • Default WordPress: every 5-15 minutes is fine. Scheduled posts, daily core checks, transient cleanup.
    • WooCommerce: every 1-5 minutes. Action Scheduler can backlog quickly under load, and the email-sending jobs need timely firing.
    • Sites with many plugin-driven cron jobs (backups, syncs, integrations): match the most frequent legitimate schedule.
  5. Verify the cron runs. After 5-10 minutes, check:

    wp cron event list --due-now

    That should show due events being picked up. Also:

    tail ~/public_html/error_log

    to confirm the cron isn’t crashing on every fire.

  6. For WooCommerce-heavy sites, also monitor Action Scheduler:

    wp action-scheduler queue-list

    A backlog in the thousands means cron isn’t running often enough or jobs are failing.

  7. If you have multiple WordPress sites in the same cPanel account, each needs its own cron entry. Don’t share one — they’ll trample each other on shared resources.

For environments with many sites where this needs to be standardized, Stack Harbor handles cron configuration as part of cPanel server administration.

Stack Harbor operates production WordPress at scale — see Enterprise WordPress for the managed model, or book a WordPress consult for a written read of your current shape.