How to disable the wp-cron.php in WordPress

By Unlimited Published 2 November 2016 Updated 6 October 2025 2 min reading time
How to disable the wp-cron.php in WordPress

In WordPress, a file called wp-cron.php is used to schedule tasks and automate some processes, such as publishing posts and so on.

WordPress is set up to call wp-cron.php everytime someone visits your site and there is a scheduled task present. WordPress calls the file and checks if anything is due to run, or be posted, and so on.

This doesn’t really make a difference to low traffic sites, but when your site starts receiving higher numbers of visitors it can impact on the load speed of your site and create resource usage issues.

In this blog post we will be showing you how to disable the wp-cron call, and how to set up a cron job to call the wp-cron every six hours.

Disabling the wp-cron.php default behaviour

Login to your cPanel and click on the File Manager.

cPanel Screenshot
 

Navigate to the wp-config.php file, select it and then click on the Code Editor.

cPanel Screenshot
 

Press ctrl-f to bring up the serach box for the Code Editor, and enter DB_COLLATE. Underneath the line with DB_COLLATE in it, add the following code –

define(‘DISABLE_WP_CRON’, ‘true’);

It should look like this –

Code editor screengrab
 

Click save changes in the top right.

WordPress will now NOT automatically run the wp-cron.php file everytime your site has a new visit.

Setup a manual cron to run wp-cron.php

The next step is to setup a manual cron that will call the wp-cron.php. We will set it up to call every six hours.

Login to your cPanel, scroll down to the advanced section and click on Cron Jobs.

cPanel screenshot
 

In the common settings drop down, select Once per hour.

cPanel screenshot
 

Select every sixth hour from the hour settings dropdown.

cPanel screenshot
 

Add the following code to the Command field –

cd /home/username/public_html; php -q wp-cron.php

Replace username with your cpanel username, in this example uwhvideo –

cd /home/uwhvideo/public_html; php -q wp-cron.php

cPanel screenshot
 

Remember, the example path shown here is for a primary domain. If you are using an addon domain, or your WordPress installation is in a sub-directory you will need to alter the path accordingly.

Click Add New Cron job.

You will get a message confirming the job has been added, and you will be able to see it in the Current Cron Jobs list.

cPanel screenshot
 

You May Also Like

Related articles you might find interesting.

WordPress

Boost Your WordPress Site Speed with Caching

7 min read. 31 March 2025. Angus.
WordPress

Unlimited Web Hosting Has Been Nominated for Monster’s Award 2022!

2 min read. 13 December 2022. Lee.
WordPress

How can plugins compromise WordPress security?

11 min read. 19 September 2021. Lee.

Running a WordPress site?

Get fast, secure and reliable WordPress Hosting with optimised for performance with AccelerateWP.

Get WordPress Hosting

Need multiple accounts?

Create fully isolated individual accounts for your clients and manage them all from one dashboard.

Get Reseller Hosting