How to Disable WP-Cron (wp-cron.php) for Faster Performance

Spread the love

CRON jobs are used to schedule tasks at periodic fixed times, dates, or intervals on your WordPress site. Some examples of a WordPress cron job might involve scheduling a post to publish, checking for updates, or a backup plugin running on a predefined schedule.

In WordPress, this is handled by WP-Cron, which is used to simulate a system cron. However, depending on the amount of traffic to your site, using the built-in cron handler can actually start to impact your page load times. So today we’ll show you how to disable WP-Cron (wp-cron.php) and instead use a system cron for faster performance.

Performance Issues with WP-Cron
How to Disable WP-Cron
How to Schedule System Cron
Performance Issues with WP-Cron

We deal with a lot of high-traffic and demanding sites at Kinsta. Because of this, we’ve seen a lot of performance issues with the WordPress built-in Cron handler: WP-Cron. First off, it’s important to understand that WP-Cron is not a real cron job, it’s simply what WordPress has created to mimic what a system cron does.

WP-Cron does not run continuously. By default, the wp-cron.php fires on every page load, which on high-traffic sites can cause problems. If a site doesn’t have enough PHP workers, sometimes a request will come in, WordPress will spawn the cron, but the cron has to wait for the worker, and therefore just sits there.

The reverse scenario is also true. If a site doesn’t have a lot of traffic, schedules could be missed due to the fact that no one has loaded a page.

A better approach is to disable WP-Cron and use the system cron instead. This runs on a pre-defined schedule and is even recommended in the official Plugin handbook.

How to Disable WP-Cron

To disable WP-Cron, add the following to your wp-config.php file, just before the line that says “That’s all, stop editing! Happy blogging.” Note: This disables it from running on page load, not when you call it directly via wp-cron.php.

define (‘DISABLE_WP_CRON’, true);
Disable WP-Cron
Boost your WordPress Site Speed by 200% 🚀

We tested 3,200+ client sites and found that some experience up to 200% faster load times just by switching to Kinsta! Try it yourself, risk free, with 30-day money-back guarantee and our free no-hassle migrations.

Speed Up Your Site
How to Schedule System Cron

You will then need to schedule wp-cron.php from your server.

If your site is a multisite, there are some extra setup steps you’ll need to take so cron jobs will run for your subsites. Here are a couple of resources we can recommend for that:

Using WP CLI to Run Cron Jobs on Multisite Networks
Running WordPress cron on a multisite instance

For single site WordPress, the great news is that if you’re a Kinsta customer, our server-side cron triggers wp-cron.php every 15 minutes by default. 💪 This will execute any scheduled WordPress crons. And if needed, you can increase the frequency by reaching out to our support team.

If you’re familiar with SSH, you can also follow our tutorial on how to manage server crons from the command line at Kinsta. All of our hosting plans include SSH access.

If you’re not a Kinsta client, we recommend checking out Properly Setting Up WordPress Cron Jobs to learn how to set up system crons.

Create Cron Job in cPanel

If you’re using a host with cPanel, you can also create a system cron from their control panel. Note: make sure you disable the default WP-Cron above first.

Step 1

Log in to cPanel. In the Advanced section, click on Cron Jobs.

cPanel cron jobs

Step 2

Under the Add New Cron Job section, you can choose from a number of different pre-defined schedules, such as twice per hour or once per week. Your hosting provider most likely has a limit on how often they allow cron jobs to be run. Twice per hour is a common setting for shared hosts.

cPanel cron job settings

Step 3

Add the following command. Replace https://domain.com with your domain name. This command might vary slightly based on how your hosting is configured. Then click on “Add New Cron Job.”

wget -q -O – https://domain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
cPanel add new cron job

The >/dev/null 2>&1 part of the command above disables email notifications.

Schedule Crons with Third-Party Solution

If you’re not comfortable with setting up cron jobs on your server or your hosting provider doesn’t provide access, you can also use a third-party solution like EasyCron.

FAQs

Frequently Asked Questions

What is a Premium Domain Name?   A premium domain name is the digital equivalent of prime real estate. It’s a short, catchy, and highly desirable web address that can significantly boost your brand's impact. These exclusive domains are already owned but available for purchase, offering you a shortcut to a powerful online presence. Why Choose a Premium Domain? Instant Brand Boost: Premium domains are like instant credibility boosters. They command attention, inspire trust, and make your business look established from day one. Memorable and Magnetic: Short, sweet, and unforgettable - these domains stick in people's minds. This means more visitors, better recall, and ultimately, more business. Outshine the Competition: In a crowded digital world, a premium domain is your secret weapon. Stand out, get noticed, and leave a lasting impression. Smart Investment: Premium domains often appreciate in value, just like a well-chosen piece of property. Own a piece of the digital world that could pay dividends. What Sets Premium Domains Apart?   Unlike ordinary domain names, premium domains are carefully crafted to be exceptional. They are shorter, more memorable, and often include valuable keywords. Plus, they often come with a built-in advantage: established online presence and search engine visibility. How Much Does a Premium Domain Cost?   The price tag for a premium domain depends on its desirability. While they cost more than standard domains, the investment can be game-changing. Think of it as an upfront cost for a long-term return. BrandBucket offers transparent pricing, so you know exactly what you're getting. Premium Domains: Worth the Investment?   Absolutely! A premium domain is more than just a website address; it's a strategic asset. By choosing the right premium domain, you're investing in your brand's future and setting yourself up for long-term success. What Are the Costs Associated with a Premium Domain?   While the initial purchase price of a premium domain is typically higher than a standard domain, the annual renewal fees are usually the same. Additionally, you may incur transfer fees if you decide to sell or move the domain to a different registrar. Can I Negotiate the Price of a Premium Domain? In some cases, it may be possible to negotiate the price of a premium domain. However, the success of negotiations depends on factors such as the domain's demand, the seller's willingness to negotiate, and the overall market conditions. At BrandBucket, we offer transparent, upfront pricing, but if you see a name that you like and wish to discuss price, please reach out to our sales team. How Do I Transfer a Premium Domain?   Transferring a premium domain involves a few steps, including unlocking the domain, obtaining an authorization code from the current registrar, and initiating the transfer with the new registrar. Many domain name marketplaces, including BrandBucket, offer assistance with the transfer process.