Book a call Free rebuild
Home/Glossary/WordPress/Heartbeat API

Heartbeat API

May 21, 2025 Updated November 16, 2026 3 min read

WordPress glossaryThe Heartbeat API keeps the browser and server in touch while someone works in the WordPress admin. It powers post locking, login checks, and live dashboard updates.

The Heartbeat API is a regular check-in between the browser and the server. While someone has the WordPress admin open, a script sends a small request to the server at a set interval, the server answers, and both sides stay up to date without a page reload. WordPress core relies on it for several features editors take for granted, and plugins can use the same channel for their own live updates.

What it does

  • Post locking. When one person opens a post, Heartbeat tells WordPress it is in use. A second person who tries to edit it sees a notice that someone else is working on it and can choose to take over.
  • Login checks. If a session expires while someone is writing, WordPress shows a login box over the editor so they can sign back in without losing their work.
  • Autosaves in the classic editor. The classic editor saves drafts through Heartbeat. The block editor autosaves through the REST API on its own timer, but still uses Heartbeat for locking and login checks.
  • Plugin features. Plugins use it for things like live notifications, order counts, or refreshing data on a dashboard screen.

How it works

Each "beat" is an AJAX POST request to /wp-admin/admin-ajax.php. Before it is sent, JavaScript collects any data that core or plugins want to pass along. The server runs the hooked PHP, builds a JSON response, and sends it back, where scripts pick out what they need.

By default, it beats every 10 seconds while a post is being edited and every 60 seconds on other admin screens, and it slows to every two minutes when the browser tab is not in focus. It runs on the front end only if a theme or plugin loads it there.

Hooks for developers

In JavaScript, add data on the heartbeat-send event and read the answer on heartbeat-tick:

jQuery( document ).on( 'heartbeat-send', function ( event, data ) {
    data.myplugin_check = true;
} );

jQuery( document ).on( 'heartbeat-tick', function ( event, data ) {
    if ( data.myplugin_count ) {
        // Update the screen.
    }
} );

In PHP, the heartbeat_received filter lets you respond to data the browser sent:

add_filter( 'heartbeat_received', function ( $response, $data ) {
    if ( ! empty( $data['myplugin_check'] ) ) {
        $response['myplugin_count'] = myplugin_get_count();
    }
    return $response;
}, 10, 2 );

Related hooks include heartbeat_send (add to every response), heartbeat_nopriv_received (for logged-out visitors), and heartbeat_settings (change the interval).

Performance and server load

Each beat boots WordPress and runs PHP, and these requests are not cached. One editor with one tab open is negligible. Several people working at once, each with a few admin tabs left open all day, adds up, and on small shared hosting plans it can push a site against its CPU limits. Plugins that do heavy work on every tick make it worse.

To see what is going on, open the browser's developer tools, go to the Network tab, and filter for admin-ajax.php. Each request's payload shows which features are riding on the heartbeat. Server access logs show the same requests from the host's side.

Controlling Heartbeat

Slow it down before switching it off. A filter in a site-specific plugin or a child theme can lengthen the interval:

add_filter( 'heartbeat_settings', function ( $settings ) {
    $settings['minimalInterval'] = 60; // seconds; no beat more often than this, in the editor too
    return $settings;
} );

Keep it at 120 seconds or less, or post locking stops working reliably.

Plugins such as Heartbeat Control, and some caching and performance plugins, offer the same settings per area: the dashboard, the post editor, and the front end. Turning it off on the front end is usually safe if nothing there depends on it. Turning it off in the editor disables post locking and login checks, removes autosaves from the classic editor, and breaks any plugin that relies on it, so it is rarely worth it. Try changes on a staging site first.

Closing admin tabs that are not in use is the simplest fix of all, since every open tab keeps beating.

Source: WordPress Plugin Handbook, Heartbeat API.

WP Services

WordPress services at revolutionary pricing.

Productized WordPress services, from builds to care, delivered by Seahawk and tracked in one app. For the WordPress lovers.