MervCodes

Tech Reviews From A Programmer

WordPress - Cron job is not working

1 min read

I spent an embarrassing amount of time debugging this on a client site. Scheduled posts weren't publishing on time, backup plugins weren't running, and email digests were hours late. Turns out, WordPress doesn't have a real cron system — it fakes it with something called WP-Cron, and that's where things go wrong.

Here's how it works and how to actually fix it.

TL;DR: If your WordPress cron job is not firing, here are the common causes and how to fix them.

How WP-Cron Works

Unlike a real server cron that runs on a schedule regardless of traffic, WP-Cron only runs when someone visits your site. If your site has low traffic, scheduled tasks like publishing future posts, sending emails, or running backups may be delayed or skipped entirely.

Common Fixes

1. Disable WP-Cron and Use a Real Cron Job

Add this line to your wp-config.php:

define('DISABLE_WP_CRON', true);

Then set up a real server cron job that hits the WP-Cron endpoint:

*/5 * * * * curl -s https://yoursite.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1

This runs every 5 minutes, ensuring your scheduled tasks fire on time regardless of traffic.

2. Check for Plugin Conflicts

Some caching or security plugins can interfere with WP-Cron. Temporarily deactivate your plugins one by one to identify if a specific plugin is blocking cron execution.

3. Check Your Hosting

Some hosting providers disable or limit wp-cron.php execution. Contact your host to confirm WP-Cron is not being blocked at the server level. This is especially common on shared hosting plans where providers try to limit server resource usage.

Sources

  1. WordPress Developer Resources
  2. WordPress.org Documentation
  3. WP Engine Documentation

Related Articles

Should I use WP Engine to host my WordPress site?

Every hosting company seems to have an ace up their sleeve, it is just that most times, it doesn't work for everyone. Let's look at WP Engine and whether it's worth the premium price.

Magento 1.9 Fix for Sending Double Emails

Fix for Magento 1.9 sending double order confirmation emails. This is a known bug that affects many Magento installations.

AI Image Generation API Guide: DALL-E and Stable Diffusion