Disable WP-Cron – how to do it!

wp-cron-illustration featured image

With my hosting, the WP-Cron is somehow only working sporadically. This also happens more often when pages have very few visitors, as WP Cron is usually triggered when someone makes a page call. Anyway: Sometimes there are cases in which you want to switch off the internal cron job of WordPress in order to then run the wp-cron.php file manually yourself in other ways.

WP-Cron runs scheduled tasks in WordPress in the background (Graphic: Mid).
WP-Cron runs scheduled tasks in WordPress in the background (Graphic: Mid).

Entry in wp-config.php disables WP-Cron

To completely disable the WordPress cron job, enter the following lines in the wp-config.php file. It doesn't matter where you put them, just try not to break other lines.

For example, you can paste the code after the line: $table_prefix = 'wp_';

Here is the code you insert to turn off the cron job:

/* WP-Cron deaktivieren */
define('DISABLE_WP_CRON', true);

This should prevent the WordPress cron job from being triggered in the future.

Here you can see where I added the lines to turn off WP-Cron.
Here you can see where I added the lines to turn off WP-Cron.

Where can I find the wp-config.php file?

Everyone who runs a WordPress website will sooner or later access the file wp-config.php need access. This file is located in the root of your WordPress installation. To be more precise, it is in the same directory as the folders wp-admin, wp-content and wp-includes can be found.

Here in the screenshot you can see the wp-config.php in the main directory of WordPress.
Here in the screenshot you can see the wp-config.php in the main directory of WordPress.

To access the file, you can use an FTP client such as FileZilla, Cyberduck, or Transmit, or use your web hosting service's file manager. Once you've logged in, simply navigate to your site's root directory and look for the wp-config.php File.

This file is important as it contains the configuration details of your WordPress installation, including database information and other settings. It is therefore advisable to make a copy of the file before modifying it.

Did you like the article and did the instructions on the blog help you? Then I would be happy if you the blog via a Steady Membership would support.

Post a comment

Your e-mail address will not be published. Required fields are marked with * marked

In the Sir Apfelot Blog you will find advice, instructions and reviews on Apple products such as the iPhone, iPad, Apple Watch, AirPods, iMac, Mac Pro, Mac Mini and Mac Studio.