WordPress Heartbeat is one of those features that is invisible until it isn’t. On a quiet site with one editor, Heartbeat fires every 15 seconds in the admin and nobody notices. On a busy site with 40 editors logged in at the same time, Heartbeat fires 160 PHP requests per minute from a single panel of users, and the host bill or PHP-FPM worker pool starts to feel it.
What’s happening
The Heartbeat API is a built-in WordPress AJAX channel that allows the browser to communicate with the server while a user is in the admin. It powers autosave for post edits, post-locking (“someone is editing this post”), session expiration warnings, and the real-time updates in the Customizer. By default it polls every 15 seconds in the post editor and every 60 seconds elsewhere in the admin.
The problem on busy sites is volume. Each heartbeat hits admin-ajax.php, which loads the full WordPress environment, runs hooks, and queries the database. On a site with 100 logged-in editors at peak, that is 6,000-25,000 admin-ajax requests per hour just from heartbeats. Combined with a plugin that hooks into heartbeat_received and does extra work, the load grows fast.
How to verify
Identify Heartbeat traffic in the access log:
grep "admin-ajax.php" /var/log/nginx/access.log \
| grep -oE 'action=heartbeat' \
| wc -l
Compare that to the total admin-ajax volume:
grep "admin-ajax.php" /var/log/nginx/access.log | wc -l
If Heartbeat accounts for more than 30% of admin-ajax requests, it is worth tuning. If your APM (New Relic, Datadog) shows admin-ajax.php as a top transaction by throughput with a high average duration, Heartbeat is likely the cause.
Check what the heartbeat does on this site:
wp shell <<< 'do_action("heartbeat_received", [], []); var_dump(get_filtered_actions("heartbeat_received"));'
Or inspect via the network panel in Chrome DevTools while logged into the admin. Filter by admin-ajax.php and watch the cadence and payload size of the heartbeat calls.
The fix
- Tune the heartbeat interval, do not disable entirely: disabling kills autosave and post-locking, which causes content-loss tickets. Instead, slow it down. Use the Heartbeat Control plugin or add to functions.php:
add_filter('heartbeat_settings', function($settings) {
$settings['interval'] = 60; // post editor — default is 15
$settings['minimalInterval'] = 60;
return $settings;
});
- Disable Heartbeat on the front-end: by default, Heartbeat does not run on the front-end, but plugins like WooCommerce can enable it for cart updates. If you do not need real-time cart updates, drop the script enqueue from the front:
add_action('init', function() {
if (!is_admin()) {
wp_deregister_script('heartbeat');
}
});
- Disable Heartbeat outside the post editor: dashboard and other admin pages do not need it. Keep it on the post editor only.
add_action('init', function() {
global $pagenow;
if ($pagenow !== 'post.php' && $pagenow !== 'post-new.php') {
wp_deregister_script('heartbeat');
}
});
- Audit plugins hooking into
heartbeat_received: every plugin that subscribes to this action adds work to every heartbeat request. Use Query Monitor orwp_filterintrospection to see who’s listening. The common offenders are notification plugins, post-status synchronizers, and analytics tools. - Move Heartbeat to a dedicated PHP-FPM pool: on a site where you cannot fully disable Heartbeat, isolate its impact. Configure Nginx to route
/wp-admin/admin-ajax.php?action=heartbeatrequests to a separate FPM pool with its own worker limit, so Heartbeat cannot starve the rest of the admin. - Confirm post-locking still works: after any tuning change, have two users edit the same post and verify the lock notification appears within the new interval.
The right tuning depends on editor count and editor behavior. A site with 5 editors typing constantly does not need 15-second autosave; 60 seconds is fine. A site with 100 editors and no shared posts can disable autosave entirely.
Stack Harbor tunes Heartbeat per-site on enterprise WordPress support accounts based on editor volume. If your admin-ajax line on the access log is dominated by Heartbeat, book a 30-minute review.