Platform Optimization

Verify a WordPress Cron Runner Before Disabling Page Loads

Verify the replacement runner before removing the page-load trigger.

A small clock connects to a server and three queued document cards, with one completed card separated in mint.

WordPress background work needs a dependable trigger and evidence that the work actually finished. Replacing visitor-triggered WP-Cron with a server scheduler can make the trigger more predictable, but a successful request alone does not prove that scheduled posts, maintenance tasks or plugin jobs completed.

Define the problem before changing the trigger

Start with a specific symptom: scheduled posts publish late, a maintenance job stays overdue, or background activity coincides with busy periods. Record the affected task, its expected time, the observed result and the timezone used by each log. A vague report that cron is slow does not distinguish a missed trigger from an expensive callback.

WP-Cron checks scheduled work when WordPress receives a page load. It does not continuously watch a clock. On a quiet site, a due event can wait until a later request provides an opportunity to run. A separate scheduler removes that particular dependence on visits, but the same application code still has to execute successfully.

Do not assume moving the trigger will improve every page's TTFB. WordPress versions differ in when they initiate cron, and hosting, database work and PHP capacity still affect response time. Treat scheduling reliability and visitor performance as separate outcomes. The broader WordPress performance workflow helps keep this change connected to representative templates and real visitor tasks.

Write an acceptance condition before making changes. For example, a harmless test event should complete within the chosen polling interval plus its normal processing time, with a visible result and a timestamp. This is a test criterion you choose for the site, not a guarantee supplied by WordPress.

Inventory scheduled work without running it

Use an account authorised to manage the installation. Identify the actual WordPress directory, production hostname, PHP environment and existing host-managed scheduling. A hosting provider may already call WP-Cron externally. Adding a second runner without checking creates unnecessary uncertainty about which process performed a task.

Where WP-CLI is available, begin with a read-only inventory:

shell
wp --path=/srv/www/site cron event list   --fields=hook,next_run_gmt,next_run_relative,recurrence   --format=table

Replace the example path with the real installation path. Keep the inventory private because hook names can reveal installed plugins or operational functions. The list describes scheduled events; it is not a history of successful execution. A recurring event's next occurrence and the previous occurrence's business outcome are different evidence.

Select a few representative jobs with their owners. Include a frequent maintenance task and a less frequent task whose next run can be observed safely. Record what completion means: a published test post, an updated timestamp, or an application-specific log entry. Avoid using a payment, bulk email or destructive cleanup operation as a casual test.

Do not remove unknown hooks to make the list look tidy. First establish which plugin or component owns them and whether repeated entries have different arguments. If jobs repeatedly accumulate, investigate their registration and execution separately from the trigger migration.

Prepare one runner and a reversible handoff

The official WordPress system-scheduler instructions describe calling wp-cron.php from an external scheduler and then disabling the page-load trigger. The order matters: establish the replacement before removing the original path.

Agree on the interval with the people responsible for time-sensitive jobs. A five-minute poll, for example, introduces an opportunity to run approximately every five minutes; it does not promise execution at an exact minute. A callback can still wait, fail or take longer than expected. Do not copy a daily example into a site that depends on frequent processing.

Choose one supported route with the host: an HTTPS request to the cron endpoint or a correctly configured local runner. For an HTTP route, verify that authentication, maintenance mode, firewall rules and redirects do not prevent the scheduler from reaching WordPress. A request that receives a challenge page is not a working cron trigger.

For a local route, confirm the executable paths, operating-system account, working directory and PHP configuration. A command working in your interactive terminal can fail under a scheduler with a smaller environment. Use absolute paths where appropriate and run the test as the same account that will own the schedule.

Before the change, save the relevant configuration and the scheduler entry. Note how to restore the prior state. Keep credentials out of publicly readable command output and logs. If a managed host owns the mechanism, use its supported controls rather than competing with an undocumented service.

Verify the replacement before disabling page loads

First invoke the proposed runner in a controlled setting and observe a known due test task. Then let the scheduler invoke it without manually loading an administrative page. This second check is essential: a visit can otherwise hide the fact that the replacement never ran.

Use three separate observations rather than a single green status:

Observation What it establishes What it does not establish
Scheduler invocation recorded The scheduling service launched something The command reached WordPress
HTTP or process result recorded The request or command returned a result Every callback succeeded
Expected task result observed The selected task produced its intended output All other tasks are healthy

For HTTP execution, record response status and duration without treating an empty response as an error by itself. Check application logs and the expected result as well. For command-line execution, retain the exit status and relevant output. Repeatedly launching a job until the dashboard turns green can duplicate side effects when the first attempt's result is merely delayed.

Once the replacement is proven, add or update the following setting in wp-config.php, without creating a second conflicting definition:

php
define( 'DISABLE_WP_CRON', true );

This disables WordPress's normal page-load spawning path. It does not delete scheduled events, remove callback code or prove that an external runner is healthy. Place the setting with the site's existing configuration conventions and check syntax before deployment.

After the switch, repeat the independent scheduler test and verify the application result. Record the exact change time so later log comparisons can distinguish the two configurations.

Separate trigger failures from callback failures

If no invocation appears, investigate the scheduling service, disabled entries, timezone assumptions and account permissions. If an invocation appears but WordPress is not reached, inspect the command path or HTTP response. Resolve a redirect, challenge or authentication failure before changing plugin code.

If WordPress is reached but a selected task does not finish, inspect that task's own logs and dependencies. A network request, database query or plugin error can fail after the trigger has done its job. Shortening the polling interval will not automatically repair the callback and may add load while the original problem remains.

Be careful with diagnostic commands. wp cron test checks the page-load spawning mechanism and reports an error when DISABLE_WP_CRON is true. That result can be expected after an intentional handoff; it is not, by itself, evidence that the external scheduler failed. Judge the new arrangement using its invocation and task-result evidence.

Commands that run events are different from inventory commands. Do not use a run-all operation as a harmless health check: it can execute work with real effects. If a manual run is needed, identify the target and its possible consequences first. Keep any plugin-specific queue investigation separate, since a cron trigger may only start another processing system.

Check capacity and observe a full operating cycle

Measure both completion delay and resource pressure after the change. Watch whether each runner finishes before the next scheduled invocation and whether the host shows repeated concurrent processes. Long-running work needs investigation; an ever-shorter interval is not a substitute for understanding it.

Compare visitor response times under similar traffic, cache and application conditions. If TTFB improves while a queue silently grows, the change has not succeeded operationally. If job reliability improves without a measurable page-speed improvement, that can still meet the stated reliability objective. Avoid attributing unrelated deployment or cache changes to the new runner.

Keep observation long enough to include the relevant schedules. A few successful minute-level checks do not validate a daily task. Establish an alert based on a missing expected completion or excessive delay, with an owner who can investigate. The alert should identify the task and last successful outcome, not just announce that a URL returned an error.

Roll back with task state in view

If the replacement cannot run reliably, restore the former configuration and remove or disable the failed runner in a controlled sequence. Confirm that an intended triggering mechanism remains available. Then check overdue work before manually replaying anything with side effects.

A rollback changes how work is triggered; it does not reverse emails already sent, posts already published or records already changed. Preserve the diagnostic evidence and identify any task whose outcome is uncertain. Resolve that uncertainty before retrying it.

Finish with a short operating record: runner owner, target installation, interval, configuration location, completion check, alert recipient and rollback procedure. A dependable handoff is one another administrator can verify without guessing which page visit happened to start the work.

Related guides