---
title: "Setting up WordPress cron jobs"
canonical_url: "https://www.zone.lv/help/kb/setting-up-wordpress-cron-jobs/"
post_type: "ht_kb"
published: "2024-04-30T13:34:31+00:00"
modified: "2025-01-10T08:59:08+00:00"
language: "en"
author: "Peeter Marvet"
taxonomies:
  ht_kb_category:
    - name: "Technical"
      url: "https://www.zone.lv/help/kb-categories/technical-en/"
    - name: "Wordpress"
      url: "https://www.zone.lv/help/kb-categories/wordpress-en/"
  ht_kb_tag:
    - name: "cron"
      url: "https://www.zone.lv/help/kb-tags/cron-en/"
    - name: "cronjob"
      url: "https://www.zone.lv/help/kb-tags/cronjob-en/"
    - name: "crontab"
      url: "https://www.zone.lv/help/kb-tags/crontab-en/"
    - name: "wordpress"
      url: "https://www.zone.lv/help/kb-tags/wordpress-en/"
---

# Setting up WordPress cron jobs

By default, WordPress uses a built-in scheduled job execution solution that generates an additional call to the web server each time the page is displayed.

On a high-traffic website, this becomes a problem because it creates an additional delay in displaying the page and uses resources meant to serve the website.

The solution is to disable WordPress from running internal scheduled jobs and set up a system cron in the `Crontab` option in the web hosting management.

To disable wp-cron, insert the following line into your `wp-config.php` file, immediately before the line that reads: “That’s all, stop editing! Happy blogging”:

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

Now that wp-cron is disabled, you can add a systematic cron job:

[![](https://www.zone.lv/static/sites/5/Zone-ee-Webadmin-14-1024x627.png)](https://www.zone.lv/static/sites/5/Zone-ee-Webadmin-14.png)

Select `System` under `Execution type` and paste the following line in the `Command` box:

```
wp cron event run --due-now --path=[[$D2ND_A]]/htdocs/
```

Scroll down to `Scheduling plan` and select `after every 5 minutes` from schedules.
Then Save changes at the bottom of the page.

Next, a line must be added to the `wp-config.php` file of the website to disable WP’s built-in cron, e.g. after the database-access setting:

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

### How do I check?

You can check `/logs/apache.ssl.access.log` file to see if WordPress internal cron jobs are stopped.

After changing `wp-config.php` there should no longer be any references to `wp-cron.php`:

```
mydomain.ee 2023-01-28T02:12:24.574229Z 217.146.69.51 38562 - - "POST /wp-cron.php?doing_wp_cron=1674871944.5444300174713134765625 HTTP/1.1"
```

You can check the performance of the system cron by having the cron send itself email notifications for output and errors. This can be done from the settings of the cron job in question:

[![](https://www.zone.lv/static/sites/5/Zone-ee-Webadmin-15-1024x347.png)](https://www.zone.lv/static/sites/5/Zone-ee-Webadmin-15.png)

After about 5 minutes, the first notification should arrive:

```
=== Information ===
Result[19950]: Success
Duration Time: 00d 00h 00m 03s
Duration Period: 2023-01-28 13:50:01 - 2023-01-28 13:50:04

=== Command Output (653.0 B) ===
Executed the cron event 'wp_privacy_delete_old_export_files' in 0.002s.
Executed the cron event 'wp_site_health_scheduled_check' in 1.631s.
Executed the cron event 'recovery_mode_clean_expired_keys' in 0.001s.
Executed the cron event 'wp_https_detection' in 0.096s.
Executed the cron event 'wp_version_check' in 0.413s.
Executed the cron event 'wp_update_plugins' in 0.354s.
Executed the cron event 'wp_update_themes' in 0.352s.
Executed the cron event 'wp_scheduled_delete' in 0.004s.
Executed the cron event 'delete_expired_transients' in 0.002s.
Executed the cron event 'wp_update_user_counts' in 0.001s.
Success: Executed a total of 10 cron events.
```

You can then turn off the notification or choose to be notified only in case of errors.
