Agency Program Get 2× more leads and save 50% on hosting. Built for agencies ready to grow. Book a call

How to Enable WP-Cron in WordPress: An Easy Guide

As a WordPress developer, mastering automated task management is essential for website efficiency. WP-Cron, the built-in scheduling feature in WordPress, simplifies automating tasks like updates, scheduled posts, and backups.  In…

VS
Vikas Singhal
Founder, InstaWP
Updated Apr 11, 2025 18 min read

As a WordPress developer, mastering automated task management is essential for website efficiency. WP-Cron, the built-in scheduling feature in WordPress, simplifies automating tasks like updates, scheduled posts, and backups. 

In this guide, we’ll deeply explore how WP-Cron works, methods to create and manage WordPress cron jobs, and critical insights into enabling, disabling, and troubleshooting your cron tasks.

Key Takeaways

  • WP-Cron is enabled by default on every fresh WordPress install. It runs scheduled tasks on page load, not on a fixed clock.
  • On low-traffic sites tasks fire late, and on high-traffic sites they can pile up. The fix is a real server-level cron that calls wp-cron.php on a schedule.
  • The reliable setup is two steps: add define( 'DISABLE_WP_CRON', true ); to wp-config.php, then schedule wp-cron.php every 5 minutes.
  • To check what is scheduled, run wp cron event list. To run everything due right now, run wp cron event run --due-now.
  • On InstaWP you skip the manual server work: use the System Cron site tool, run cron through WP-CLI, or manage events in plain English using an AI assistant connected through InstaMCP.

What is a cron job?

A cron job is a task that runs automatically on a schedule, either at a set time or at a regular interval. The name comes from cron, the time-based job scheduler built into Unix and Linux systems. Instead of remembering to run something by hand, you tell the server “do this every five minutes” or “do this at 2 a.m. every day,” and it happens on its own.

In WordPress, scheduled tasks keep your site healthy without any manual effort. Common examples include:

  • Publishing scheduled posts at the exact time you set
  • Running automatic backups
  • Checking for plugin, theme, and core updates
  • Sending email newsletters and notifications
  • Deleting expired transients and cleaning up old post revisions
  • Triggering API calls, syncs, and order processing in WooCommerce

When these tasks run consistently, your site stays current and reliable. When they do not, scheduled posts go out late, backups get skipped, and automations silently fail. That is exactly the problem WP-Cron solves, and also where it can let you down.

What is WP-Cron and How Does It Work?

WP-Cron is WordPress’s internal task scheduler that executes time-based tasks or events without relying on the server’s cron job utility. It runs scheduled jobs every time a visitor loads a page on your website. 

This ensures broad compatibility, even with shared hosting environments lacking server-level cron access.

Imagine you want your WordPress website to do certain tasks automatically on a regular schedule, like checking for updates, sending out email newsletters, or backing up your content. These scheduled tasks are like having a little robot that works behind the scenes – that’s what WordPress “cron jobs” help you set up.

Must read: Mastering WP-Cron: A Guide for WordPress Developers

WP-Cron Lifecycle

1

Visitor requests a webpage

A page load is what wakes WP-Cron up.

2

WP-Cron checks scheduled events

It looks for any tasks that are now due.

3

Due events trigger on page load

Tasks run inside that same request.

No visit means no trigger, which is why low-traffic sites need a real server-level cron.

Out of the box, WordPress ships with these recurring intervals, and plugins can register more:

Interval Runs Typical use
hourly Every 60 minutes Cache cleanup, lightweight checks
twicedaily Every 12 hours Update checks
daily Once every 24 hours Backups, digests, cleanup
weekly Once every 7 days Reports, long-cycle maintenance

You can add your own interval with the cron_schedules filter, which is handy when a task needs to run more often than hourly:

add_filter( 'cron_schedules', function ( $schedules ) {
    $schedules['every_five_minutes'] = array(
        'interval' => 300, // seconds
        'display'  => 'Every 5 Minutes',
    );
    return $schedules;
} );

If you want the full background on the system, including how events are stored and spawned, our deep dive on what WP-Cron is and how it works walks through the internals. For now, the key point is simple: because WP-Cron depends on visits, its timing is only as reliable as your traffic.

Did you know?

Every InstaWP site is MCP-ready with a single toggle, and InstaMCP 1.1 connects 13 AI clients including Claude Desktop, Claude Code, Claude.ai, Cursor, and ChatGPT. That means you can connect an AI assistant to your WordPress site and ask it, in plain English, which cron events are scheduled and which ones are overdue, instead of digging through code.

When should you set up a real server-level cron?

Default WP-Cron is fine for a hobby blog or a low-stakes site. But because it leans entirely on page loads, it breaks down in predictable situations. Switch to a real server-level cron when any of these apply to you:

  • Low-traffic sites. If nobody visits at the time a task is due, it simply does not run until the next visit. A “daily” backup can drift by hours or days.
  • High-traffic sites. WP-Cron can spawn on many simultaneous requests, leading to overlapping processes and wasted server resources.
  • Aggressive caching. When pages are served from cache, PHP may not execute on every request, so the cron trigger never fires.
  • Time-critical tasks. Scheduled posts that must publish at midnight, payment retries, API syncs, and automations need exact timing that traffic-based cron cannot promise.
  • You manage many sites. Inconsistent cron behavior across dozens of installs is hard to debug. A fixed server schedule makes every site behave the same way.

For any production environment we recommend a real server cron, even if you do not run a caching plugin. It guarantees that scheduled tasks fire at fixed intervals and never depend on whether a visitor happens to be on your site.

Test your cron setup safely first

Editing wp-config.php and adding crontab entries on a live site is risky. A small mistake can stop every scheduled task, and you might not notice until backups go missing. Before you change anything on production, reproduce the setup on a throwaway copy.

This is where a cloud sandbox earns its keep. You can create a free WordPress sandbox on InstaWP in a few seconds, complete with WP-CLI and SSH access, test your exact cron configuration, confirm that wp cron event run --due-now behaves the way you expect, and only then apply the same steps to your live site.

If you already have a production site, spin up a WordPress staging site from it instead so you are testing against real data.

Spin up a free WordPress sandbox to test cron in seconds

No local setup, no risk to your live site. Add a card and get $25 in free credits to explore everything.

Get started free

How to Enable (or re-enable) WP-Cron

WP-Cron is on by default, so most people who search for how to “enable WordPress cron” are really trying to turn it back on after it was disabled, often by a host or a previous developer. To check, open wp-config.php in your site’s root folder and look for this line:

define( 'DISABLE_WP_CRON', true );

If it is present and set to true, the built-in trigger is off. To re-enable the default behavior, either delete that line or set it to false:

define( 'DISABLE_WP_CRON', false );

Save the file and upload it back to the server. WP-Cron will resume running on page loads. That is genuinely all “enabling” WP-Cron means. The more valuable question, and the rest of this guide, is how to make it run reliably as a real cron job.

Method 1: Using functions.php

The functions.php file is a special file within your theme where you can add custom code to make your website do extra things.

Go to Appearance > Theme File Editor and look for functions.php.

Method 1: Using functions.php

Add the below code: 

add_action('custom_cron_hook', 'my_custom_cron_function');

function my_custom_cron_function() {

    // Your cron task logic here

}

if (!wp_next_scheduled('custom_cron_hook')) {

    wp_schedule_event(time(), 'hourly', 'custom_cron_hook');

}

Method 2: Using WordPress Cron Job Plugin 

If you don’t prefer coding, using a WordPress cron job plugin is a code-free way to enable WP-Cron on WordPress. 

Go to the “Plugins” section in your WordPress dashboard and click “Add New.” Search for any WordPress cron job plugin.

Method 2: Using WordPress Cron Job Plugin 

Click “Install Now” next to the plugin. Once installed, click “Activate.” For the sake of this guide, we’re using WP Crontrol. Here is how you can create cron events with WP Crontrol. After activating the plugin, you’ll find a new option under “Tools” in your WordPress dashboard called “Cron Events.”

Cron Events.

Click on “Cron Events.”

You’ll see a list of all the currently scheduled cron jobs.

You'll see a list of all the currently scheduled cron jobs.

You can select from the given cron event lists and enable WP-cron. To add a new one, click the button that says something like “Add Cron Event.”

Add new Event

You’ll then be presented with a form where you can easily fill in the details:

  • Hook Name: This is like the ‘custom_cron_hook’ we used in the code. It’s a unique name for your scheduled task.
  • Arguments (optional): Sometimes, your task might need extra information. You can specify that here (don’t worry about this for basic tasks).
  • Recurrence: This is where you choose how often you want the task to run (e.g., hourly, daily, weekly).

Which method should you use?

  • Method 1 is more powerful and allows for very specific customization, but it requires some understanding of coding (specifically PHP). It’s generally preferred by developers.
  • Method 2 is much easier for beginners because it provides a visual interface. You don’t need to write any code, making it less prone to errors.

For most beginners, using the WordPress cron job plugin is the recommended and simpler way to manage WordPress cron jobs. It lets you see what’s scheduled and easily add or modify tasks without touching any code.

How to Disable WP-Cron in WordPress

Disabling WP-Cron can prevent important automatic tasks from running on your website. Only do this if you know what you’re doing.

Here are the steps:

Step 1: Access Your Website’s Files

You’ll need a special program called an FTP client (like FileZilla, Cyberduck, or your web hosting provider might have a file manager you can use through your browser).

You’ll also need your FTP login details. Your web hosting provider usually gives you these when you sign up. This includes a hostname, username, and password.

Open your FTP client and enter your FTP login details to connect to your website’s server.

Open your FTP client and enter your FTP login details to connect to your website's server to disable WP-Cron.

Step 2: Find the wp-config.php File

Once you’re connected to your server, you’ll likely see a list of folders.

Look for a folder that’s usually named after your website’s main domain (like yourdomain.com or public_html or www).

Inside this main folder, you should find a file named wp-config.php. This is a crucial file that contains important configuration settings for your WordPress site. Be very careful when editing this file!

Look for wp-config.php. file to disable WP-Cron

Step 3: Download the wp-config.php File 


Before you make any changes, it’s a good idea to create a backup of this file. Right-click on the wp-config.php file in your FTP client.

Select the option to “Download” the file to your computer. This way, if anything goes wrong, you can easily upload the original file.

Select the option to "Download" the file to your computer. This way, if anything goes wrong, you can easily upload the original file.

Step 4: Edit the wp-config.php File

Find the wp-config.php file that you just downloaded onto your computer.

Right-click on it and open it with a simple text editor (like Notepad on Windows or TextEdit on Mac). Don’t use a word processor like Microsoft Word, as it can add extra formatting that can break your website. 

Step 5: Add the Code to Disable WP-Cron

Inside the wp-config.php file, look for the line that says <?php at the very beginning. Scroll down a bit until you find a line that says /* That's all, stop editing! Happy blogging. */. Just before this line (the “stop editing” line), paste the following code:

define('DISABLE_WP_CRON', true);

Make sure you type or copy this code exactly as it is, paying attention to capitalization and spacing. In your text editor, go to “File” and then “Save.”

Step 6: Upload the Modified wp-config.php File 

Go back to your FTP client. Find the wp-config.php file on your computer (the one you just edited and saved).

Drag and drop this file back into the same folder on your server where you found the original file.

Your FTP client might ask if you want to overwrite the existing file. Click “Yes” or “Overwrite”.

Step 6: Upload the Modified wp-config.php File 

Once the file has been successfully uploaded, you can close your FTP client.

Congratulations! You have now disabled WP-Cron.

What happens now?

WordPress will no longer automatically run its scheduled tasks. If you disabled WP-Cron, you’ll likely need to set up an alternative way to run those important tasks, often using a feature provided by your web hosting company called a “real” cron job. This is usually more reliable for busy websites.

⚠️ Important Reminder

Be very careful when editing the wp-config.php file. Making mistakes here can cause your website to break. If you are unsure about any of these steps, it is always best to ask for help from your web hosting provider or a WordPress developer.

How to Check if WP-Cron is Enabled

When you’re handling multiple client sites, you might forget which ron job is enabled on which site. Hence, you have to re-check it. Here is how you can do it. 

Method 1: Using WordPress Cron Job Plugin (The easy, visual way)

Remember that plugin we talked about earlier, WP Crontrol? It helps you see what automatic tasks are scheduled. Here’s how you can use it to check if WP-Cron is enabled:

  1. Go to your WordPress Dashboard: This is the main control panel of your website (usually yourdomain.com/wp-admin).
  2. Find “Tools” in the left-hand menu: Click on it.
  3. Click on “Cron Events”: You should see this option if you have the WP Crontrol plugin installed and activated.
  4. Look at the list: If you see a list of scheduled tasks (they’ll have names and tell you when they are supposed to run next), then WP-Cron is likely enabled and working! It means WordPress has a schedule of things it needs to do automatically. If you don’t see any tasks listed, then WP-Cron might be disabled or not set up correctly.
Method 1: Using WordPress Cron Job Plugin (The easy, visual way)

Method 2: Using WP-CLI (A more technical way)

This method involves using something called WP-CLI (WordPress Command Line Interface). Think of it like talking directly to your website’s server using text commands, instead of clicking buttons on a screen.

SSH into your server: This is like getting a secure connection to your website’s computer (the server). It’s a bit more advanced and you might need help from your web hosting provider to get this set up. If you’re using InstaWP, you can skip this step, as you can run the required WP-CLI command to check if WP-Cron is enabled directly on your site. 

ommands’ to add the command
  • Add ‘wp cron event list’ command. This command is basically asking WordPress to show you a list of all the scheduled cron events.
wp cron event list
  • Go to your site and click on the three-dot sign to expand the menu. Select ‘ Commands’ from the list. 
Commands’ from the list
  • Select the command from the list. 
Select the command from the list

If you see a list of events with future dates and times, it means WP-Cron is active. It’s showing you that there are tasks scheduled to run in the future. If you don’t see any events or get an error, WP-Cron might not be working.

How to Run WP-Cron Manually

Sometimes you might need to tell WordPress to run its scheduled tasks immediately, instead of waiting for the next scheduled time. Here are two ways to do that:

Via browser (A simple way to trigger it):

  • Open your web browser (like Chrome, Firefox, Safari, etc.).
  • Type in the following address in the address bar, replacing yourdomain.com with your actual website address:

    https://yourdomain.com/wp-cron.php?doing_wp_cron
  • Press Enter.

When you visit this special link, it basically pings WordPress and tells it to run any cron jobs that are currently due. You might not see a specific confirmation page, but WordPress will try to execute the scheduled tasks in the background.

Via WP-CLI (Another way using the command line):

Again, you’ll need to go to the InstaWP Dashboard, access your site, and runwp cron event run --due-now’ command.  This command specifically tells WordPress to run all the cron events that are currently scheduled to be executed. WP-CLI might show you some information about which cron events were run.

Did you know?

As a fully managed WordPress hosting provider, InstaWP handles the server side for you. With InstaWP Connect, you can create a staging site with a single click, replicate your production environment, and run WP-Cron tasks manually and safely, with no file transfers or complicated setups required.

When might you need to run WP-Cron manually?

  • Sometimes, scheduled tasks might not run exactly when you expect them to. Manually triggering WP-Cron can help you run them immediately, for example, if you’re expecting an email to be sent or a backup to happen.
  • If you’ve just set up a new scheduled task and you don’t want to wait for the next automatic run, you can trigger it manually to test if it’s working correctly.

Remember, WP-Cron is important for keeping your WordPress site running smoothly with automatic tasks. Understanding how to check its status and run it manually can be helpful for managing your website.

Best Practices for Managing WP-Cron

Managing WP-Cron involves following multiple good habits for setting up your website’s automatic tasks. Here is what it involves: 

Avoid Duplicate Cron Events: 

Imagine accidentally telling your automatic robot to do the same job multiple times at the same time. That would be inefficient and could slow down your website.

You don’t want your website wasting resources by doing the same thing over and over unnecessarily. This is why you must always verify with wp_next_scheduled before scheduling tasks.
This is like asking WordPress, “Hey, is this specific task already on the schedule?” If it is, you don’t need to add it again. This prevents those duplicate jobs. 

Regular Audits

Just like you might clean out old files on your computer, it’s a good idea to regularly look at the list of automatic tasks your website is doing.

Over time, you might have set up tasks that you no longer need. These unnecessary tasks can still use up your website’s resources.

To make it happen, use a WordPress cron job plugin, like the WP Crontrol plugin is great for this. Just go to “Tools” -> “Cron Events” and see what’s listed. If you see anything you don’t recognize or no longer need, you can usually delete it.

Optimized Task Intervals

You need to think about how often a task needs to run. For example, does your website need to back up its entire database every single minute? Probably not! That would use a lot of resources.

Scheduling tasks too frequently can put a strain on your website’s server, potentially slowing it down for your visitors.

Struggling to manage cron task intervals across multiple client sites? With InstaWP’s built-in configuration manager, you can centrally adjust schedules and optimize cron tasks to improve site performance with minimal hassle

Conclusion

WP-Cron gives WordPress developers a dependable way to automate the tasks that keep a site healthy, from backups and scheduled content to routine maintenance. The catch is that the default trigger leans on traffic, so for any production site the real win is running it as a true server-level cron with consistent timing.

That is where a managed platform changes the math. InstaWP is an all-in-one WordPress cloud platform to build, host, manage, and sell sites, with managed hosting that handles the server layer for you.

Instead of editing config files on every install, you flip the System Cron site tool, run cron through WP-CLI from the dashboard, or manage events in plain English with an AI assistant connected through InstaMCP. You get reliable scheduling, easy debugging, and scalable control across all your sites, which leaves you free to focus on what actually matters: building great WordPress websites.

VS
Vikas Singhal
Founder, InstaWP

Vikas builds tools that take the friction out of WordPress development. He writes about WP-CLI, dev workflows, and running WordPress at agency scale.