# Replace WP-Cron with a real cron job
Source: https://docs.webgee.com/en/hosting/wordpress/enhancing-wordpress-performance-disabling-wp-cron-for-faster-load-times



Stop WordPress running its scheduled tasks on page load, and run them on a real
schedule instead. Applies to shared, reseller and Premium hosting.

## Why WP-Cron is a problem [#why-wp-cron-is-a-problem]

WP-Cron is not a cron job. It is a workaround: WordPress checks for due tasks
**every time someone loads a page**.

That fails in both directions:

* **On busy sites**, every visitor may trigger the check. If PHP workers are
  saturated, a request arrives, WordPress starts the cron, and the cron waits for
  a worker — so the visitor waits too. This is a common contributor to
  [503 resource limit errors](/en/performance/understanding-and-resolving-the-503-error-resource-limit-reached).
* **On quiet sites**, scheduled tasks simply do not run, because nobody loaded a
  page. Scheduled posts miss their time and backups do not happen.

A real cron job fixes both: it runs on a fixed schedule regardless of traffic,
and never blocks a visitor. WordPress's own plugin handbook recommends it.

## 1. Disable WP-Cron [#1-disable-wp-cron]

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

```php
define( 'DISABLE_WP_CRON', true );
```

This stops the page-load trigger. It does not stop `wp-cron.php` running when
called directly — which is exactly what the next step does.

## 2. Add a system cron job [#2-add-a-system-cron-job]

1. In cPanel, open **Cron Jobs**.
2. Set the schedule to **Once Per Five Minutes**, or enter `*/5 * * * *`.
3. Enter the command:

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

Replace `cpaneluser` with your cPanel username, and adjust the path if WordPress
is not in `public_html`.

<Callout type="info">
  Five minutes suits most sites. Going more frequent recreates the load problem
  you are solving; going less frequent delays scheduled posts. If you use
  WooCommerce, keep it at five — order processing and stock updates depend on it.
</Callout>

The `> /dev/null 2>&1` suppresses output. Without it, cPanel emails you the
result every five minutes — see
[Stop cron emails](/en/hosting/how-do-i-stop-suppress-cron-emails-from-being-sent-or-logged).

## Check it worked [#check-it-worked]

Install [WP Crontrol](https://wordpress.org/plugins/wp-crontrol/) and open
**Tools → Cron Events**. Events should show as running on schedule, and the
notice about WP-Cron being disabled confirms step 1 took effect.

You can also confirm directly:

```bash
cd /home/cpaneluser/public_html && php -q wp-cron.php && echo "ran ok"
```

## If scheduled tasks stop running [#if-scheduled-tasks-stop-running]

* **The path is wrong.** cPanel does not validate it. Run the command manually
  over SSH and see what it reports.
* **WordPress is in a subdirectory.** Adjust the `cd` path accordingly.
* **`DISABLE_WP_CRON` was added below the "stop editing" line**, where it has no
  effect. Move it above.

## Related [#related]

* [Managing cron jobs in cPanel](/en/hosting/managing-cron-jobs-in-cpanel)
* [Fix a 503 Resource Limit Reached error](/en/performance/understanding-and-resolving-the-503-error-resource-limit-reached)
* [Improve a slow WordPress or WooCommerce dashboard](/en/hosting/wordpress/how-to-improve-a-slow-wordpress-or-woocommerce-dashboard)
