1. Home
  2. Hosting
  3. cPanel Hosting
  4. How to Disable WP-CRON to Improve WordPress Page Load Times
  1. Home
  2. Hosting
  3. Problem Solving
  4. How to Disable WP-CRON to Improve WordPress Page Load Times

How to Disable WP-CRON to Improve WordPress Page Load Times

This article assumes you are already logged into your cPanel account, if you do not already know how, please review How To Change Your Password as it will teach you how to log in from your client area.

Issue: Your WordPress site is slow to load.

If your WordPress site is slow to load,  one reason could be a built-in feature called WP-CRON. Imagine having someone constantly tapping you on the shoulder every time you try to work, asking if you have any chores to do. That’s kind of what WP-CRON does to your site.

Normally, cron jobs are like helpful reminders that pop up at specific times, like “Hey, it’s time to publish that blog post!”  But WP-CRON checks for these reminders every single time someone visits your site.  This is okay for small websites, but for busy ones, it can make your website load slower.

You can easily turn off this over-enthusiastic checker and set up a smoother system.

Think of your website visitors like cars on a highway. With low traffic, there’s no problem for WP-CRON to quickly check for tasks. But on a high-traffic site, it’s like rush hour, and all that checking creates a jam, slowing things down for everyone.

On the other hand, with very few visitors, WP-CRON might miss important tasks altogether, like publishing a new post or running a backup. Not ideal!

A Two-Step Solution

To fix this, we’ll switch to a system that works more like a reliable traffic light.

Step 1). Set Up a New Cron Job: This is like a dedicated lane for important tasks. You can usually do this through your hosting provider’s control panel.  They’ll tell you exactly what to enter, but it’s often just a line of code that tells your server to check for tasks at specific times.

1. Navigate to cPanel >> Advanced >> Cron Jobs


2. Create a new cron job

wget -q -O - https://example.com/wp-cron.php?doing_wp_cron

Replace https://example.com with your domain name.

After clicking on the “Add New Cron job” button, you will get a confirmation like the one below:

Step 2). Turn Off WP-CRON: This tells the annoying checker to take a break. You can edit a file on your site called wp-config.php (don’t worry, it’s easier than it sounds!). There’s a special code you can add that tells WP-CRON to be disabled.

By following these steps, you can ditch the overzealous WP-CRON checker and give your website the performance boost it deserves!

Prevent WordPress from checking for scheduled events on every page load

1). Login to your cPanel dashboard.
2). In the Files Section, click on File Manager
3). Click on the /public_html folder
4). Right-click the wp-config.php file and select edit.


5). Just before the /* That’s all, stop editing! Happy publishing. */ line, insert the following code: define(‘DISABLE_WP_CRON’, true) ;

This prevents WP-CRON from executing on page load but not when called directly.

OTHER WAYS TO IMPROVE WORDPRESS PAGE LOAD TIMES:

Install and Configure the WordPress Heartbeat Plugin
If you notice a lot of admin-ajax.php requests, you can disable the WordPress Heartbeat API to stop this from happening automatically. Read our Knowledgebase Article on “How to Install and Configure the WordPress Heartbeat Plugin.”

Use a Caching Plugin
Since our shared servers, including our WordPress-optimized server are all LiteSpeed Servers, using LiteSpeed Cache for WordPress (LSCWP) together will improve performance. Read our Knowledgebase Article on “How to Install LiteSpeed Cache for WordPress (LSCWP)“.

Use a Content Delivery Network
If your web visitors are worldwide, they might experience latency due to the physical distance between them and Iceland. Fortunately, content delivery networks (CDNs) can solve this problem by having cached versions of your websites loaded into their network of servers and data centers strategically placed around the world. Retrieving web files and interacting with a database in your region, will definitely be faster than trying the same from a server on the other side of the world. Read our Knowledgebase Article on “How to Install Cloudflare CDN for WordPress”.

Use Optimized Images
A good rule of thumb is to use images no larger than 100kb in size, especially on your home page. You can manually do this with online tools such as:
tinify
Optimizilla

There are also WordPress plugins that can do this:
Smush

Not a customer? Did you like this knowledgebase article?
If you did like this knowledgebase article and are not currently a customer but are looking for a trusted offshore host, feel free to browse what we have to offer over at OrangeWebsite. We have products that fit everyone from individuals to small, medium, and big-sized businesses. We just might be what you are looking for.




Updated on July 29, 2024
Was this article helpful?

Related Articles