Optimising WordPress Cron (wp-cron) – Firstserv

WordPress does not use a true system scheduler by default. Instead, it relies on a file called wp-cron.php, which runs scheduled tasks whenever someone visits your website.

While this works for smaller sites, it can become inefficient and resource-intensive on busy or highly optimised websites.


Why Is wp-cron Inefficient?

High-Traffic Websites

On busy sites, wp-cron.php is triggered every time a page is loaded.

For example:

  • 100 visitors per hour
  • Each views 3 pages
  • = 300 executions per hour
  • = 7,200 executions per day

This can lead to:

  • Increased CPU usage
  • High memory consumption
  • Multiple overlapping cron processes running simultaneously
  • Slower website performance

Low-Traffic or Cached Websites

On quieter or highly cached sites, the opposite can happen:

  • wp-cron.php may not run often enough
  • Scheduled tasks (e.g. publishing posts, clearing cache) may be delayed

Recommended Solution

To improve performance and reliability, we recommend:

Disable WordPress’s built-in cron system
Replace it with a scheduled cron job via cPanel

This gives you full control over how often tasks run.


Step 1: Disable wp-cron in WordPress

  1. Log in to cPanel → File Manager
  2. Locate your WordPress installation directory
  3. Open the wp-config.php file
  4. Find the following line:
define('WP_DEBUG', false);

(You may see true instead—this is fine.)

  1. Add the following line directly underneath:
 
 
 
 
 
 
PHP
 
 
define('DISABLE_WP_CRON', true);
 
 
 

Your configuration should now look similar to:

 
 
 
 
 
 
PHP
 
 
define('WP_DEBUG', false);
define('DISABLE_WP_CRON', true);
 
 
  1. Save the file

Step 2: Create a Cron Job in cPanel

Next, set up a scheduled job to replace WordPress’s automatic system.

Command to Use

 
 
 
 
 
 
Shell
 
 
/usr/bin/wget -O /dev/null https://yourdomain.com/wp-cron.php?doing_wp_cron
 
 

Replace yourdomain.com with your actual domain name.


Choosing the Right Schedule

The ideal schedule depends on how your site operates:

Run More Frequently (e.g. every 5–15 minutes) if:

  • You publish scheduled posts
  • You run an e-commerce store
  • You rely on frequent updates or integrations
  • You experience spam filtering delays

Run Less Frequently (e.g. hourly or daily) if:

  • Your site has low activity
  • Tasks do not need real-time execution

General Recommendation

  • Minimum: Once per day
  • Maximum: Once per minute

Benefits of This Approach

Switching to a real cron job provides:

Reduced server load – no unnecessary repeated executions
Improved performance – fewer background processes
Better reliability – tasks run on a predictable schedule
Greater control – you decide how often tasks execute


Final Notes

After setting this up:

  • Monitor your website to ensure everything works as expected
  • Adjust the schedule if tasks run too slowly or too often
  • Check features like scheduled posts, emails, and plugins

Summary

By disabling WordPress’s default cron and replacing it with a cPanel cron job, you can:

  • Improve site speed
  • Reduce resource usage
  • Ensure consistent task execution

If you need help setting up cron jobs or optimising your WordPress performance, the Firstserv support team is always available to assist.

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to install the Wordpress Litespeed cache plugin

  LiteSpeed Cache – What It Is and How It Helps If you’re running a WordPress website and...

Fixing WordPress mixed content issues

  Fixing Mixed Content Warnings When you visit a website using https://, your browser expects...

How to optimise your WordPress site

Optimising Your WordPress Website (Firstserv Guide) WordPress is a...

Configuring Redis Object Caching using Litespeed Cache

Object Caching and Redis (Firstserv Guide) What is Object Caching? Object caching is a...

How to fix the "cURL error 60: SSL certificate problem" WordPress issue

Fixing SSL Errors in WordPress (Firstserv) Overview From time to time, WordPress websites...