How to Monitor a WordPress Site (and Fix What Breaks)
WordPress sites rarely go down cleanly. More often the server is up, the homepage still loads from a cache, and something behind it is broken: the database, a plugin, a scheduled job, the certificate. A basic "is it responding?" check misses most of that. This guide covers how WordPress actually fails, what to monitor so you catch each failure, a small health-check endpoint you can add, and the recovery steps to run when an alert fires.
How WordPress sites fail
The white screen of death
A PHP fatal error, usually from a plugin or theme update, stops rendering midway. Since WordPress 5.2, the core fatal-error handler shows "There has been a critical error on this website" and returns HTTP 500, and it emails the admin a recovery-mode link. But depending on the host, caching layer and PHP settings, you can still get a blank or half-rendered page with a 200 OK status. A status-code check alone will not see that; a keyword check will.
"Error establishing a database connection"
MySQL or MariaDB is down, out of connections, or the credentials in wp-config.php are wrong. WordPress shows this message on every uncached page. If you use a page cache or CDN, cached pages (often including the homepage) keep loading normally, so a monitor on the homepage may stay green while every other page is broken.
Plugin and theme update breakage
Automatic or bulk updates are the most common trigger for a sudden outage. A plugin may fatal-error on your PHP version, conflict with another plugin, or break only one template, such as checkout or the contact form.
Stuck maintenance mode
During updates, WordPress creates a .maintenance file in the site root and serves "Briefly unavailable for scheduled maintenance. Check back in a minute." with a 503. If the update is interrupted, the file stays and the site stays in maintenance mode until someone deletes it.
wp-cron not running
WordPress's scheduler, wp-cron, is not a real cron. It is triggered by page visits. On a low-traffic site, or a site where every page is served from a full-page cache, scheduled posts miss their time, backup plugins skip runs, and WooCommerce emails are delayed. If someone set DISABLE_WP_CRON to true but never added a system cron job, nothing scheduled runs at all. The site looks fine, so nobody notices.
xmlrpc.php abuse
xmlrpc.php is a common target for password-guessing and pingback abuse. A flood of requests to it ties up PHP workers, so real visitors get slow pages, timeouts or 502/504 errors from the web server in front.
Expired or broken SSL
Let's Encrypt certificates last 90 days. Renewal fails silently after a DNS change, a server migration or a web server config edit, and the first sign is a browser warning that drives visitors away.
Hacked or defaced pages
Compromised sites may have their content replaced, show injected spam, or redirect visitors to another domain. Some infections only redirect certain visitors (for example, mobile users or visitors arriving from search engines), so no external check catches every case, but outright defacement and site-wide redirects are visible to a monitor.
What to monitor
| Monitor | URL | Settings | Catches |
|---|---|---|---|
| Homepage | https://example.com/ | Keyword from the footer; SSL monitoring on; follow redirects off | Server down, DNS, SSL, defacement, unexpected redirects, stuck maintenance |
| A database-backed page | A recent post, product or /shop/ | Keyword specific to that page | Database errors and plugin fatals hidden by the homepage cache |
| Health endpoint | /wp-json/uptime/v1/health | Keyword "status":"ok" | Database, wp-cron backlog, PHP fatals |
On a single free monitor, pick the health endpoint if you can add it, otherwise a database-backed page with a good keyword.
Why turn off follow-redirects on the homepage
If your homepage normally returns 200, any redirect is suspicious: a hacked site sending visitors elsewhere, a misconfigured HTTPS or www rule, or a plugin forcing a login page. With follow-redirects off, a redirect makes the check fail with the cause redirect_3xx instead of silently following it. Make sure you monitor the final canonical URL (with or without www, with the trailing slash WordPress uses) or every check will fail.
Choosing good keywords for WordPress
The required keyword should appear only when the page has fully rendered. On WordPress that means:
- Footer text from your theme, such as a copyright line or a footer menu label. The footer is rendered last, so a fatal error midway through the page removes it.
- Something from the main content of the monitored page, such as a product name, to prove the database query ran.
Avoid your site title, which the <title> tag can carry even on a half-rendered page, and avoid anything plugins change often, such as dates, prices on sale or "latest posts" lists. Remember the check is for text that must be present; you cannot list error phrases to watch for, so pick something that only a healthy page contains. The idea is covered in more depth in keyword monitoring for broken pages that return 200 OK.
A health endpoint for WordPress
A small must-use plugin can expose a REST endpoint that checks the database and the wp-cron backlog. Must-use plugins load automatically and cannot be deactivated from the admin, which is what you want for monitoring. Save this as wp-content/mu-plugins/uptime-health.php:
<?php
/**
* Plugin Name: Uptime health check
*/
add_action('rest_api_init', function () {
register_rest_route('uptime/v1', '/health', [
'methods' => 'GET',
'permission_callback' => '__return_true',
'callback' => function () {
global $wpdb;
$checks = [];
$checks['database'] = $wpdb->get_var('SELECT 1') === '1';
// Events more than an hour overdue mean wp-cron is not being triggered.
$overdue = 0;
foreach ((array) _get_cron_array() as $timestamp => $hooks) {
if ($timestamp < time() - HOUR_IN_SECONDS) {
$overdue += count($hooks);
}
}
$checks['cron'] = $overdue === 0;
$ok = ! in_array(false, $checks, true);
$response = new WP_REST_Response([
'status' => $ok ? 'ok' : 'fail',
'checks' => $checks,
], $ok ? 200 : 503);
$response->header('Cache-Control', 'no-store');
return $response;
},
]);
});
Test it:
curl -i https://example.com/wp-json/uptime/v1/health
A healthy site returns 200 and {"status":"ok","checks":{"database":true,"cron":true}}. In the monitor, set the required keyword to "status":"ok". If the database is completely unreachable, WordPress cannot boot and returns its database error page instead, which also fails the check.
Notes: if your permalinks are set to "Plain", use https://example.com/?rest_route=/uptime/v1/health. Some security plugins block the REST API for anonymous visitors; allow this route, or protect it with HTTP Basic Auth at the web-server level and enter the credentials in the monitor. The output reveals nothing sensitive, which is deliberate.
Fixing wp-cron properly
If the health check reports overdue cron events, replace visit-triggered cron with a real one. In wp-config.php:
define('DISABLE_WP_CRON', true);
Then add a system cron job for the web server user (crontab -e -u www-data on Debian/Ubuntu), adjusting the path:
*/5 * * * * wp cron event run --due-now --path=/var/www/example.com --quiet
Without WP-CLI, request the cron endpoint instead:
*/5 * * * * curl -s https://example.com/wp-cron.php?doing_wp_cron > /dev/null
Dealing with xmlrpc.php
If you do not use the WordPress mobile app, Jetpack or another tool that needs XML-RPC, block it at the web server so the requests never reach PHP. In nginx:
location = /xmlrpc.php {
deny all;
}
In Apache 2.4 (.htaccess or the vhost):
<Files "xmlrpc.php">
Require all denied
</Files>
A response-time threshold on your monitor (for example, alert after 3 consecutive checks slower than 3,000 ms) is a good early warning for this kind of load, before it turns into timeouts.
Recovery steps when an alert fires
- Look at the cause and screenshot.
server_5xx,keyword_missing,timeoutandssl_errorpoint to very different problems. The screenshot captured when the status code changed shows whether it is a critical-error page, a database error or a maintenance screen. (A keyword failure keeps the200status, so it does not trigger a screenshot; open the page yourself.) - Stuck maintenance? Delete the
.maintenancefile in the WordPress root, then rerun the update that was interrupted. - Turn on logging in
wp-config.php, above the "That's all, stop editing!" line:
Reload the page and readdefine('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false);wp-content/debug.log. The fatal error names the file, and the path tells you which plugin or theme is at fault. TurnWP_DEBUGoff again when done. - Disable the faulty plugin. With WP-CLI, which still works when the site is broken if you skip loading plugins and themes:
If you cannot tell which one it is, deactivate all of them, confirm the site recovers, then reactivate one at a time:wp plugin list --status=active --skip-plugins --skip-themes wp plugin deactivate plugin-slug --skip-plugins --skip-themes
Without WP-CLI, rename the plugin's folder over SFTP (for examplewp plugin deactivate --all --skip-plugins --skip-themeswp-content/plugins/plugin-slugtoplugin-slug.off); WordPress cannot load it and deactivates it. Renaming the wholepluginsfolder disables every plugin at once. - Theme at fault? Switch to a default theme:
wp theme activate twentytwentyfour --skip-plugins --skip-themes(use whichever default theme is installed). - Database error? Check that the database server is running and that the credentials in
wp-config.phpare correct, then look for "too many connections" in the database log. - Purge caches after the fix, so visitors and the monitor see the repaired site.
For a structured approach to the first minutes of any outage, see the website-down checklist for the first 15 minutes.
Planned updates without false alarms
Schedule plugin and core updates, and set a maintenance window in the monitor for that period. Checks and alerts are suppressed during the window, so the brief 503 from WordPress's own maintenance mode does not page anyone, and the check after the window ends confirms the site came back. If the update left the site broken, you find out minutes later instead of the next morning. Recurring weekly windows suit sites that update on a fixed day.
Checklist
- Homepage monitored with a footer keyword, SSL monitoring on and follow-redirects off.
- A database-backed page or
/wp-json/uptime/v1/healthmonitored with its own keyword. - Real system cron instead of visit-triggered wp-cron.
xmlrpc.phpblocked if unused; response-time alert set.- WP-CLI available on the server, and the recovery commands saved somewhere you can find at 3 a.m.
- Maintenance window set for scheduled updates.
Argos Uptime handles all of this for a WordPress site: keyword and status checks, SSL warnings, response-time alerts, screenshots of what visitors saw when the status code changed, and maintenance windows for update days. You can start free with one site and monitor the health endpoint above at 5-minute intervals.