How To Disable WordPress Cron Handler
The wp-cron.php file on your WordPress website is responsible for automatic publishing of scheduled posts, checking of themes and plugins updates, and even sending email notifications but also causing high loads to the website. However, this can be disabled from wp-config.php file and can be manually set up in cPanel.
1. Editing Wp-config.php File
Follow the steps below on how to add the code to wp-config.php file that disables the WordPress cron handler.
NOTE: The steps provided below are for editing the wp-config.php file via cPanel’s File Manager. Editing of wp-config.php file can be done via FTP as well.
- Log in to cPanel.
- Click the File Manager button under Files category.
- Access your WordPress website files and right-click on wp-config.php file.
TIP:
- The main domain’s website files are in public_html folder
- An addon domain’s website files are in the addon directory.
- A subdomain’s website files are in the subdomain’s directory.
- Click Edit.
- Click Edit on the pop-up.
- Copy and paste the code below on line 45.
define('DISABLE_WP_CRON', 'true');
It should appear like what is shown in the screenshot below.
- Click the Save Changes button.
The WordPress cron handler is now disabled. Next, set up the cron job on cPanel for the scheduled tasks of your WordPress website.
2. Setting up Cron Job in cPanel
It’s still important to carry out the WordPress scheduled tasks. These tasks can be accomplished with cron jobs that is set up in the cPanel to avoid the slowing of your WordPress website. Follow the steps below for the setup.
- Log in to cPanel.
- Scroll down to Advanced category and click Cron Jobs.
- Under Common Settings, select Once Per Hour from the drop-down options.
- Copy the code below.
cd /home/cpanelusername/public_html; php -q wp-cron.php
- Paste it in the box provided for Command.
NOTE: You do not have to do anything else if this warning does not show. It means that the domain or subdomain is already connected to the WordPress Hosting.
- Click the Add New Cron Job button.
A message showing a successful addition of cron job will show in the page. The list also displays the cron job you just added.
Please don’t hesitate to contact our 24/7 Singapore or Australia Support Team if you have further questions.