📝 The Post That Published Itself Twice
WP-Cron isn’t a real system scheduler – every single page load on the site is what actually checks whether any due cron event is overdue and fires it, with no built-in lock against two requests landing in the same second and both deciding the same scheduled post is due. On a moderately busy site, or one where a caching layer, a monitoring uptime checker, and a real visitor all happen to load pages within the same minute, two separate requests can each independently trigger the publish event for the same post before either one has a chance to see the other already did it.
🔎 The Problem
Scheduled post set for 9:00 AM, site also has an external uptime monitor pinging every 60 seconds and object caching enabled What actually happens around 9:00 AM: 1. An uptime monitor request lands at 8:59:58 and triggers wp-cron.php's check for due events - the post isn't due yet by a couple seconds, so nothing fires. 2. A real visitor loads a page at 9:00:02, wp-cron.php runs again, sees the post is now due, and starts publishing it. 3. Before that publish finishes writing the post status, a second near-simultaneous request (another visitor, a REST API call from a mobile app, a second monitor hit) also runs its own wp-cron.php check, independently sees a status that still looks "not yet published" in its own cached read, and fires the same publish event a second time. 4. Depending on the theme and any publish-triggered plugin (social auto-poster, email notification, webhook), the result is the same post appearing to publish twice in quick succession, each trigger re-running its own "on publish" side effects independently. Nothing in the Site Health or scheduled posts screen ever shows two separate publish events - WordPress itself only sees one final post status, "publish," regardless of how many times the transition into it actually fired along the way.
✅ Fix: Give WP-Cron an Actual Lock, Not Just a Schedule
- Disable the default page-load-triggered cron entirely by setting DISABLE_WP_CRON to true in wp-config.php, and instead run wp cron event run –due-now (or call wp-cron.php directly) from a real system cron job on a fixed interval – a single external trigger removes the race between multiple concurrent page loads each deciding independently that an event is due.
- If a plugin-based solution is preferred over editing wp-config.php, use a cron-control plugin that adds an actual locking mechanism around event execution, so a second near-simultaneous trigger can see an event is already running and skip it instead of firing it again from scratch.
- For any custom code hooked to a publish-transition action, make it explicitly idempotent – check a post meta flag before running the side effect (sending a notification, posting to social, calling a webhook) and set that flag as the very first thing the hook does, so a duplicate trigger finds the flag already set and does nothing.
🚨 Why This Is Dangerous
- Because WordPress’s own post status only ever shows the single final ‘publish’ state, there’s no built-in audit trail that even proves the duplicate firing happened – diagnosing this usually means correlating timestamps in a separate social-posting plugin’s own log or an email provider’s send history, not anything inside WordPress itself.
- The failure mode gets dramatically worse the more traffic or monitoring a site has, which means a staging environment with a single developer casually clicking around almost never reproduces it, right up until the exact same scheduled-post setup goes live on a busier production site and starts double-firing immediately.
WP-Cron was never a scheduler waiting quietly in the background – it’s a race that every single page load enters, and a scheduled post only avoids running twice because most of the time, nobody actually wins at the same instant.
Related posts:

WordPress: Fix a Custom Nav Menu Walker Class Silently Being Ignored Because the Theme's wp_nav_menu...

WordPress: Fix a Scheduled Post That Silently Stays in Draft Because WP-Cron Never Actually Fires
