Web & Development

WordPress Cron Not Working? How to Fix Scheduled Tasks and Missed Posts

WordPress Cron Not Working? How to Fix Scheduled Tasks and Missed Posts

WordPress scheduled posts not publishing? Learn how to diagnose WP-Cron problems, inspect scheduled events, fix loopback errors, and configure a reliable server cron job step by step.

You schedule a WordPress article for 9:00 AM. At 9:30, it still hasn't appeared.

Or perhaps your WooCommerce emails arrive late, scheduled backups never start, or a plugin reports that its background tasks are overdue.

These problems often have something in common: WP-Cron, WordPress's built-in task scheduling system.

WP-Cron is convenient because it works without requiring access to your hosting server's task scheduler. But unlike a traditional system cron job, it doesn't continuously run in the background.

In this guide, you'll learn how WP-Cron works, how to identify the cause of delayed tasks, and how to replace its default triggering mechanism with a reliable server cron job when necessary.

We'll cover both shared hosting and servers with command-line access.

1. How WP-Cron actually works

A traditional Linux cron daemon checks its schedule independently of website traffic.

WP-Cron works differently. WordPress checks for scheduled tasks during normal website activity and, when appropriate, attempts to launch a request to wp-cron.php.

That means a scheduled event isn't guaranteed to execute at its exact scheduled time.

Imagine a website that receives its last visitor at 10:00 PM. A backup is scheduled for 2:00 AM, but nobody visits the site overnight.

The backup may not start until WordPress receives another request that triggers its scheduling system.

How the two scheduling methods differ

Default WP-Cron: Visitor request → WordPress checks events → Due tasks start. It depends on WordPress requests.

Server cron: Server scheduler → Runs every five minutes → Due tasks start. It operates independently of visitor traffic.

A server cron job doesn't change the way WordPress stores scheduled events. It simply provides a more predictable way to check and execute them.

2. Recognize the symptoms before changing anything

Not every delayed WordPress operation is caused by WP-Cron.

Start by identifying the actual symptom.

Symptom Possible explanation
Scheduled posts show "Missed schedule" Cron trigger delayed or failed
Scheduled emails arrive late Cron delay, queue processing, or mail delivery issue
Automatic backups never start Missing event, cron failure, or backup plugin error
WooCommerce actions remain pending Action Scheduler processing problem
Site Health reports a loopback error WordPress cannot reliably request its own URL
Tasks run only after visiting the website Traffic-dependent cron triggering

The important distinction is between a task that never starts and a task that starts but fails.

Replacing WP-Cron with a server scheduler may solve the first problem. It won't automatically repair a broken plugin, an unavailable database, or a failing email service.

3. Check WordPress Site Health first

Before touching configuration files, open the WordPress administration interface.

  1. Go to Tools → Site Health.
  2. Open the Status tab.
  3. Look for warnings related to scheduled events or loopback requests.
  4. Record the exact message before making changes.

A loopback request is a request WordPress makes to its own website.

If these requests fail, scheduled tasks may not be triggered correctly.

Common causes include an incorrect website URL, DNS resolution problems, SSL certificate issues, HTTP authentication, firewall restrictions, or conflicts with plugins and themes.

Example: a staging site protected by a password

Suppose you've created a WordPress staging environment at:

https://staging.example.com

The staging site requires HTTP Basic Authentication.

WordPress attempts to request its own wp-cron.php endpoint, but the server returns HTTP 401 because the request isn't authenticated.

The problem isn't necessarily the scheduled task itself. The request that should trigger the task is being rejected.

In this situation, you can use a server-side CLI scheduler, which avoids the public HTTP loopback route, or configure the environment so WordPress's internal requests work correctly.

Don't remove password protection from a staging site simply to make cron work.

4. Inspect scheduled tasks with WP-CLI

If you have SSH access and WP-CLI installed, you can inspect the scheduler directly.

First, move into your WordPress installation directory.

cd /path/to/wordpress

Then list scheduled events:

wp cron event list

You'll see information such as the hook name, next scheduled execution, and recurrence.

For a machine-readable output:

wp cron event list --fields=hook,next_run_gmt,recurrence --format=json

What should you look for?

Pay attention to events whose next execution time is in the past.

An overdue event is a useful warning sign, but one overdue event alone doesn't prove that the entire scheduler is broken.

Check whether multiple unrelated hooks are overdue. If they are, investigate the global triggering mechanism.

Illustration of the article's main concept

If only one plugin's events are affected, inspect that plugin first.

Run due tasks manually

On a staging environment, or after confirming the consequences on production, run:

wp cron event run --due-now

This asks WordPress to execute events that are currently due.

Be careful: this command performs real work. It may publish scheduled content, send messages, initiate backups, or trigger ecommerce operations.

It is not a harmless diagnostic preview.

If it completes successfully but the tasks later become overdue again, your problem may be the automatic triggering mechanism rather than the task callbacks.

5. Replace traffic-dependent WP-Cron with a server cron job

For a production website where scheduled tasks matter, a server cron job is often a better choice.

The objective is straightforward:

  • Stop WordPress from trying to spawn WP-Cron automatically on normal page requests.
  • Ask the server to process due events at regular intervals.

Step 1: edit wp-config.php

Make a backup of wp-config.php.

Add this configuration before the line that tells you to stop editing:

define('DISABLE_WP_CRON', true);

This disables WordPress's default automatic cron spawning. It does not delete the scheduled events stored by WordPress.

Step 2: create a scheduled task on your hosting server

Open your hosting control panel and find its cron job scheduler.

For a standard WordPress installation, you can schedule a PHP CLI command similar to:

/usr/bin/php /home/account/public_html/wp-cron.php

Replace both the PHP executable path and the WordPress installation path with the actual values provided by your host.

The command must run the correct PHP version and have permission to read the WordPress files.

If WP-CLI is installed, another option is:

cd /home/account/public_html && /usr/local/bin/wp cron event run --due-now

This alternative explicitly processes due WordPress events through WP-CLI.

Use one scheduling method for a given installation rather than configuring several independent cron jobs to do the same thing.

Step 3: choose a suitable interval

For a typical website, five minutes is a reasonable starting point.

Execution interval Scheduler invocations per day Maximum polling delay* Example crontab expression
1 minute 1,440 1 minute * * * * *
5 minutes 288 5 minutes */5 * * * *
10 minutes 144 10 minutes */10 * * * *
15 minutes 96 15 minutes */15 * * * *
30 minutes 48 30 minutes */30 * * * *

*Assumes a functioning scheduler and short-running tasks. Actual execution may be delayed by server load or long-running callbacks.

For example, every five minutes:

*/5 * * * *

A one-minute interval offers more frequent checks but isn't necessary for every website.

For a low-traffic blog, five or ten minutes may be entirely sufficient. For a busy ecommerce store, you may need more frequent processing depending on its background workload.

Step 4: test the result

After configuring the server job, wait for at least two scheduled intervals.

Then inspect the event list again:

wp cron event list

Confirm that previously overdue events have been processed.

Check the hosting cron logs as well.

You should also verify a real business operation: a scheduled test post, a harmless maintenance task, or another operation whose result can be observed safely.

6. What if your host doesn't provide SSH access?

You can still configure a server cron job on many shared hosting plans.

Some hosting panels support a scheduled URL request, for example:

https://example.com/wp-cron.php

Others offer PHP command execution without providing an interactive SSH terminal.

Prefer a PHP CLI task when supported. A scheduled HTTP request may be affected by redirects, access restrictions, security rules, or network problems.

If your hosting panel only supports HTTP requests, confirm that the endpoint is reachable and that the request is actually triggering due tasks.

Do not assume that receiving an HTTP 200 response proves every scheduled callback completed successfully.

Technical workflow illustration

7. Create a safe test event

For developers, a small test plugin can help confirm that the scheduling system works independently of existing plugins.

Create this file:

wp-content/plugins/ceikay-cron-test/ceikay-cron-test.php

Add:

<?php
/**
 * Plugin Name: CeiKay Cron Test
 * Description: Temporary diagnostic cron event.
 */

if (!defined('ABSPATH')) {
    exit;
}

add_action('ceikay_cron_test', function () {
    error_log(
        'CeiKay cron test executed at ' .
        gmdate('Y-m-d H:i:s') .
        ' UTC'
    );
});

register_activation_hook(__FILE__, function () {
    if (!wp_next_scheduled('ceikay_cron_test')) {
        wp_schedule_event(
            time() + 60,
            'hourly',
            'ceikay_cron_test'
        );
    }
});

register_deactivation_hook(__FILE__, function () {
    wp_clear_scheduled_hook('ceikay_cron_test');
});

Activate the plugin from the WordPress administration interface.

It registers an hourly event that writes a simple diagnostic message to the PHP error log. It doesn't send emails, alter content, or make external network requests.

The first event is scheduled approximately one minute after activation.

To test it immediately after activation with WP-CLI:

wp cron event run ceikay_cron_test

Check the PHP error log for a message similar to:

CeiKay cron test executed at 2026-11-18 07:30:00 UTC

The timestamp is only an example.

If you prefer to test the automatic scheduler rather than manually executing the hook, wait for the event to become due and allow the configured cron mechanism to process it.

When testing is complete, deactivate and delete the diagnostic plugin.

8. Troubleshooting: the cron job runs, but tasks still fail

A working cron trigger is only one part of the system.

If your server scheduler runs successfully but WordPress operations continue to fail, use the following diagnostic table.

Problem What to check Suggested action
No scheduled events listed Plugin may not have registered its hook Check plugin activation and scheduling code
Events remain overdue Server job may not be executing Check cron logs, PHP path and permissions
PHP fatal error Task callback or plugin failure Inspect PHP error logs and stack trace
HTTP 401 or 403 Authentication or firewall Review loopback access restrictions
HTTP 500 Application or server failure Inspect PHP/server logs
Events execute but emails don't arrive Mail transport issue Check SMTP or email delivery logs
Duplicate executions Duplicate schedules or overlapping processes Inspect hooks, arguments and locking
WooCommerce actions remain pending Action Scheduler backlog Inspect the scheduled actions interface and individual failures

Don't blindly delete overdue events

It may be tempting to remove every event that looks stuck.

Avoid doing that.

An event might represent a legitimate scheduled payment-related operation, order processing task, email delivery, or backup.

Deleting the event can remove the scheduled work without fixing the underlying problem.

WP-CLI provides commands to delete events, but these should be used only after identifying the hook and understanding its purpose.

9. Avoid duplicate scheduled events in your own plugins

If you're developing a WordPress plugin, a common mistake is registering the same recurring event repeatedly.

For example, scheduling a task on every page load without checking whether it already exists.

The correct approach is to check first:

if (!wp_next_scheduled('myplugin_daily_cleanup')) {
    wp_schedule_event(
        time() + HOUR_IN_SECONDS,
        'daily',
        'myplugin_daily_cleanup'
    );
}

Then register the callback separately:

add_action('myplugin_daily_cleanup', function () {
    // Perform a small, bounded maintenance task.
});

If the event accepts arguments, use consistent arguments when scheduling, checking, and clearing it. WordPress uses the hook and arguments to distinguish scheduled events.

Also consider execution duration. A task that processes thousands of records in one request can exhaust PHP execution time or memory.

For large workloads, process data in small batches, make operations safe to retry, and record progress.

10. A practical checklist for a reliable WordPress scheduler

Before considering the problem solved, verify these points:

  • [ ] WordPress Site Health shows no unexplained scheduling or loopback errors.
  • [ ] The expected scheduled hooks exist.
  • [ ] Server cron executes at the intended interval.
  • [ ] DISABLE_WP_CRON is configured only after an alternative trigger is ready.
  • [ ] The cron job uses the correct PHP executable and WordPress path.
  • [ ] A real scheduled task completes successfully.
  • [ ] Logs can be consulted when a task fails.
  • [ ] No duplicate scheduler configuration is active.
  • [ ] Critical operations have their own monitoring or failure alerts.

A reliable scheduler isn't just one that runs. It's one whose failures you can identify and investigate.

11. Final thoughts: when should you use server cron?

For a small personal blog with occasional visitors and no time-sensitive automation, default WP-Cron may be perfectly adequate.

But if your website relies on scheduled publishing, background maintenance, ecommerce processing, or other recurring operations, a server cron job is worth considering.

The improvement isn't that server cron magically makes every WordPress plugin reliable. It removes one important source of uncertainty: dependence on incoming website requests to trigger due events.

Start by diagnosing the actual failure, inspect the scheduled events, and only then change the triggering mechanism.

That approach is safer than installing another plugin or modifying configuration settings without knowing what went wrong.