Choosing Between WP‑Cron and System Cron in WordPress: A Practical Decision Guide
Decide whether to use WordPress’s built‑in WP‑Cron or a system‑level cron job. Compare reliability, performance, and hosting constraints, and see a step‑by‑step example of disabling WP‑Cron and setting up a deterministic cron entry.
01 Jan 2026, 00:03 UTC

Problem: When to Use WP‑Cron vs. a System‑Level Cron?
WordPress ships with an internal scheduling system called WP‑Cron. It runs scheduled tasks whenever a visitor loads a page. Many sites rely on it because it requires no extra configuration. However, for high‑traffic, mission‑critical, or low‑traffic sites, the built‑in mechanism can be unreliable or inefficient. The alternative is to set up a system‑level cron job that calls wp-cron.php on a fixed schedule, bypassing the traffic trigger.
Decision Context and Constraints
Before choosing, consider these constraints:
- Reliability: Will the task run even if the site receives no traffic?
- Server load: Does the site need to keep page load times low?
- Hosting environment: Is shell access or cron editing allowed?
- Maintenance overhead: How much manual configuration is acceptable?
- Time‑zone drift: Are the server and WordPress time zones aligned?
Option Comparison
| Feature | WP‑Cron | System Cron |
|---|---|---|
| Trigger Mechanism | Page load (visitor traffic) | Fixed schedule (e.g., every 5 minutes) |
| Reliability on Low Traffic | Low – may never fire | High – runs regardless of visits |
| Per‑Request Overhead | Yes – PHP loads WordPress on each page view | No – runs as a separate background process |
| Time‑zone Handling | Depends on WP settings; can drift if mismatched | Server time zone; more predictable |
| Hosting Restrictions | Works on all hosts (no shell access needed) | Requires shell access or cPanel cron editor |
| Setup Complexity | Zero – built‑in | Requires crontab or hosting cron editor |
| Maintenance Overhead | Low – no extra files | Moderate – cron file and monitoring |
| Debugging Visibility | Limited – logs inside WordPress | Full control – can log to file, syslog |
Trade‑Off Analysis
Reliability vs. Simplicity
If your site is highly visited, WP‑Cron will fire often enough to keep tasks on schedule. For low‑traffic or critical background jobs (e.g., sending newsletters, clearing caches), a system cron guarantees execution.
Performance Impact
Each page request that triggers WP‑Cron loads the entire WordPress stack, adding latency. On busy sites, this can become noticeable. A system cron keeps the web server free from that overhead.
Hosting Constraints
Shared hosts often disable shell access, making system cron impossible unless the host provides a cron UI. In that case, you can still schedule wp-cron.php via the host’s interface.
Maintenance
WP‑Cron needs no configuration but can become a maintenance burden if you need to disable it or debug failures. System cron requires an extra crontab entry, but you can monitor it with standard Unix tools.
Concrete Implementation: Switching to System Cron
Below is a step‑by‑step guide to replace WP‑Cron with a system cron job on a typical Linux server. Adjust paths and URLs to match your environment.
1. Verify Existing Scheduled Events
# WP‑CLI – check scheduled events
wp cron event list
# Expected output: list of events with next run times
2. Disable WP‑Cron in WordPress
Add the following line to wp-config.php just before the /* That's all, stop editing! */ comment:
define('DISABLE_WP_CRON', true);
After saving, WP‑Cron will no longer trigger on page loads.
3. Create a System Cron Entry
Open the crontab editor for the web user (often www-data):
sudo crontab -u www-data -e
Add a line to run wp-cron.php every 5 minutes. Use wget or curl to avoid PHP memory usage in the web context:
*/5 * * * * wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Replace https://example.com with your site's URL. The query string doing_wp_cron prevents WordPress from attempting to schedule a new cron job during the request.
4. Verify the Cron Is Running
Check the crontab listing:
sudo crontab -u www-data -l
# Should show the line you added
Run the cron job manually to confirm it executes:
wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
5. Add a Test Scheduled Action
In functions.php or a custom plugin, create a simple scheduled event that writes a timestamp to a log file. This confirms that system cron triggers the event correctly.
function my_test_cron_job() {
$log = __DIR__ . '/cron-test.log';
$now = date('Y-m-d H:i:s');
file_put_contents($log, "Cron fired at $now\n", FILE_APPEND);
}
add_action('my_test_event', 'my_test_cron_job');
if (!wp_next_scheduled('my_test_event')) {
wp_schedule_event(time(), 'five_minutes', 'my_test_event');
}
After the next 5‑minute interval, check cron-test.log for a new entry. If you see a timestamp, the system cron is functioning.
Monitoring and Maintenance Tips
- Use
cronologor logrotate to manage the log file size. - Set up an email alert for cron failures: add
MAILTO=[contact removed]to the crontab. - Periodically run
wp cron event listto ensure no events are stuck. - Keep the
DISABLE_WP_CRONflag in sync with any caching plugins that may rely on WP‑Cron.
Conclusion
For high‑traffic sites, WP‑Cron’s simplicity may suffice; for low‑traffic or mission‑critical tasks, a system cron offers deterministic scheduling and lower per‑request overhead. By disabling WP‑Cron and scheduling wp-cron.php via the server’s cron system, you gain reliability while keeping your site’s performance intact.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.