Technical Mid Level

How does WP-Cron work, and how does it differ from a real server cron? What are the limitations and how do you work around them?

Quick Tip

Show production awareness: "I disable WP-Cron and use a real server cron hitting wp-cron.php every minute. This ensures tasks run on time regardless of traffic. For heavy background processing, I use Action Scheduler."

What good answers include

WP-Cron is triggered by page visits, not by the system clock. On each request, WordPress checks if any scheduled events are due and runs them. Limitations: events do not fire if there is no traffic, multiple near-simultaneous visitors can trigger the same event, and cron tasks add latency to the triggering request. Workarounds: disable WP-Cron in wp-config (DISABLE_WP_CRON) and set up a real server cron that hits wp-cron.php at regular intervals. For heavy tasks: use Action Scheduler (used by WooCommerce) which queues jobs in the database and processes them in batches. Strong candidates mention: wp_schedule_event for recurring tasks, wp_schedule_single_event for one-off tasks, and the importance of checking if an event is already scheduled before adding it.

What interviewers are looking for

Tests understanding of WordPress internals. Candidates who do not know WP-Cron is visitor-triggered will schedule critical tasks that silently fail on low-traffic sites. Those who know to use a real cron and Action Scheduler demonstrate production readiness.

← All WordPress questions