Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared Managed Cloud India
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Best lists Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Speed & performance · Guide

How to Control the WordPress Heartbeat API

Short answer

The WordPress Heartbeat API is a built-in polling system that sends short messages between the browser and the server every 15 to 120 seconds. It powers autosave, post locking and login warnings in the admin. Control it by slowing the tick to 60 seconds with a plugin such as Heartbeat Control or Perfmatters, or with the heartbeat_settings filter in code.

Key takeaways

  • The Heartbeat API is a built-in polling system from WordPress 3.6 that sends messages every 15 to 120 seconds.
  • It powers autosave, post locking and login warnings in the admin area.
  • Slowing the editor tick from 15 to 60 seconds cuts those requests by 75%.
  • Heartbeat Control and Perfmatters let you set the frequency per screen without code.
  • Disabling Heartbeat everywhere also disables autosave and post locking.

What is the WordPress Heartbeat API?

The WordPress Heartbeat API is a built-in polling system that lets the browser and the server exchange short messages while a page stays open.

The Plugin Handbook describes it as a simple server polling API built into WordPress, allowing near-real-time frontend updates.

When a page loads, the browser sets up an interval called a tick, and each tick sends data to the server and waits for a reply. The server handles the message, prepares a response and returns it as JSON.

Heartbeat arrived with WordPress 3.6, according to the developer reference for the heartbeat_settings filter. It uses the same admin AJAX endpoint as other background requests: wp-admin/admin-ajax.php. No plugin is needed to run it, since it ships with WordPress core.

The name fits how it works. Like a heartbeat, it pulses on a timer, checking in with the server again and again while you work. Each pulse is small, but on a busy site with many logged-in users, the pulses add up.

What does Heartbeat do?

Heartbeat powers autosave, post locking and login warnings in the WordPress admin.

Autosave is the feature most people notice. While you write a post, Heartbeat sends the draft to the server on a timer, so a browser crash loses less work.

Post locking is the second job: when one editor opens a post, Heartbeat tells other editors the post is taken, so two people do not overwrite each other.

Heartbeat also keeps the login session alive and warns before it expires. Plugins use it too, for live notifications, background sync and activity tracking.

The Plugin Handbook explains the flow: a plugin adds data on the heartbeat-send event, the server answers through the heartbeat_received filter, and the browser reads the reply on the heartbeat-tick event.

On the front end, Heartbeat is quiet by default. It runs mainly on admin screens, and a plugin has to add front-end calls before any happen there. That is why most Heartbeat load comes from the dashboard, not from visitors.

Speed problems often start in the admin, so learn how to make WordPress faster overall.

How often does Heartbeat run?

The tick runs every 15 to 120 seconds, and the exact gap depends on where you are.

The Plugin Handbook states the range plainly: the client-side code sets up a tick to run every 15 to 120 seconds.

On the post editor the tick runs every 15 seconds, and on other admin screens it runs every 60 seconds, according to SolidWP's Heartbeat guide.

The Heartbeat Controller plugin page on WordPress.org gives the same working range: requests every 15 to 60 seconds.

The gap matters because the cost multiplies.

One editor with a 15-second tick sends 4 requests a minute, or 240 in an hour. Ten editors with dashboards open all day send thousands of requests that do little except say “I am still here”.

On shared hosting, that steady load can push CPU use up for no visible benefit.

The interval is not fixed. WordPress exposes the heartbeat_settings filter, which the developer reference documents, and the interval value can sit anywhere from 15 to 60 seconds. A longer interval means fewer requests, but slower autosaves and slower post-lock warnings.

How do you know Heartbeat is slowing your site?

Look for high admin-ajax.php use in your host's resource stats, and for slow saves in the editor.

Most hosts show CPU use and the busiest URLs in their dashboard.

If admin-ajax.php sits at the top of the list while the site has few visitors, Heartbeat is a likely cause, since it is the main source of admin AJAX traffic. A host support team can confirm it from the server logs if the dashboard does not show it.

The symptoms are easy to spot. The editor feels slow to save, the dashboard takes long to load with many users logged in, or the host warns about CPU limits during work hours. The problem usually appears on sites with several editors, or on one editor who leaves many dashboard tabs open.

Check the obvious causes first. A plugin that polls the server on its own can look like a Heartbeat problem, and a slow host can make every request slow. Disable Heartbeat controls one at a time and watch the stats, rather than guessing from a single slow afternoon.

Core Web Vitals cover the front end, but admin speed has its own causes.

How do you control Heartbeat with a plugin?

A plugin is the easiest route, and the free Heartbeat Control plugin is the simplest choice.

Heartbeat Control, by WP Rocket, is listed free on WordPress.org.

ScalaHosting's guide notes that it has more than 100,000 active installations. After installing and activating it, open “Settings” then “Heartbeat Control”.

You can allow, disable or modify the frequency separately for the dashboard, the post editor and the front end.

Set the post editor to 60 seconds first.

Moving the editor tick from 15 seconds to 60 seconds means one request instead of four in the same minute, which is 75% fewer requests from that screen.

Keep the dashboard at 60 seconds too, and leave the front end alone unless a plugin has added Heartbeat calls there.

Perfmatters offers the same control inside a wider performance plugin.

Its documentation lists four frequency options, 15, 30, 45 and 60 seconds, and recommends the 60-second option.

Open “Settings” then “Perfmatters”, go to the “General” tab, scroll to “Heartbeat Frequency”, pick 60 seconds and save. Perfmatters also has a “Disable Heartbeat” switch on the same screen.

If you already run WP Rocket or Perfmatters, use the Heartbeat control inside it. Installing a second plugin for the same job adds code the site does not need.

How do you control Heartbeat with code?

Two filters and one function give you full control without a plugin.

The heartbeat_settings filter changes the interval. Add this to a child theme's functions.php file, or better, to a small site-specific plugin so the change survives theme updates:

add_filter( 'heartbeat_settings', function( $settings ) {
    $settings['interval'] = 60;
    return $settings;
} );

The value sits in seconds, and the working range is 15 to 60. The developer reference for wp_heartbeat_settings shows that the filter feeds the settings WordPress prints for the Heartbeat script. A value above 60 is ignored, so 60 is the slowest the filter allows.

To stop Heartbeat on a screen, deregister its script. This snippet stops it everywhere in the admin:

add_action( 'init', function() {
    wp_deregister_script( 'heartbeat' );
}, 1 );

Use that only when you understand the cost. The code runs early, at priority 1, so the script never loads. Test the editor after adding it, and remove the snippet if autosave or post locking stops working the way your team needs.

Reducing unused JavaScript is a separate job from slowing Heartbeat, but the two often go together.

Should you disable Heartbeat completely?

Slowing Heartbeat is usually better than switching it off.

Disabling Heartbeat stops autosave, post locking and login warnings at once. A team that writes long posts loses the safety net that saves drafts while they work. Two editors can open the same post with no warning, and the last save wins, wiping out the other person's work.

There are cases where disabling fits. A site with one editor who writes short posts and saves by hand loses little. A front end with no logged-in users gains nothing from Heartbeat, so disabling it there is safe when a plugin has added front-end calls.

The middle path suits most sites.

Slow the editor tick to 60 seconds, slow the dashboard to 60 seconds, and disable Heartbeat only on the front end or only on screens that do not need it.

That keeps autosave and post locking while cutting the request count to a quarter of the default on the editor.

LocationDefault tickSuggested settingWhat you lose
Post editor15 seconds60 secondsSlower autosave and lock warnings
Dashboard60 seconds60 secondsNothing, this is already the default
Front endOff by defaultDisable if a plugin added callsNothing, unless a plugin needs it
EverywhereMixedDisable only as a last resortAutosave, post locking, login warnings

How do you check that your change worked?

Watch admin-ajax.php traffic and test the editor after the change.

First, confirm the setting saved.

In Heartbeat Control, reopen the settings screen and check the values stuck. In Perfmatters, reopen the “General” tab and confirm the frequency reads 60 seconds.

For code, view the page source on an edit screen and confirm the Heartbeat script still loads with the new interval.

Second, watch the host stats for a day. Admin AJAX requests should fall, and the drop should be largest during work hours, when editors are active. If the numbers do not move, another plugin may be polling the server on its own, and the Heartbeat change was not the cause.

Third, test the features Heartbeat powers.

Write a draft and wait for the autosave note to appear. Open the same post in a second browser and confirm the lock warning shows.

If either fails, the interval is too long for your team, or Heartbeat is off where it should be on.

Site Health flags background update and loopback problems that look like Heartbeat trouble.

What mistakes should you avoid?

The most common mistakes are disabling Heartbeat everywhere, editing the wrong file and chasing the wrong cause.

First, do not disable Heartbeat on the whole site to fix a slow front end. Heartbeat barely runs on the front end, so the fix does nothing for visitors and breaks autosave for editors. Slow the editor and dashboard ticks instead, and look elsewhere for front-end speed.

Second, do not add the code to a parent theme's functions.php file. The next theme update overwrites it, and the Heartbeat setting silently returns to the default. Use a child theme or a site-specific plugin, and write down where the snippet lives.

Third, do not set the interval below 15 seconds or above 60 seconds. Values outside that range are ignored or clamped, so the change does nothing while looking like it worked. Stick to the documented range, and use 60 seconds as the slowest setting.

Fourth, do not blame Heartbeat before checking the host stats. A single plugin that polls admin-ajax.php every few seconds can dwarf Heartbeat traffic. Find the real caller first, then decide whether Heartbeat needs changing at all.

WP Rocket has its own Heartbeat controls, so check its settings before adding another plugin.

Frequently asked questions

Does Heartbeat slow down my site for visitors?

No. Heartbeat runs mainly in the admin, and it is quiet on the front end unless a plugin adds calls there. Visitors never see it directly. Its cost is server CPU and admin slowness, not page load time for readers.

Which plugin should I use to control Heartbeat?

The free Heartbeat Control plugin by WP Rocket is the simplest choice. It lets you allow, disable or change the frequency separately for the dashboard, the post editor and the front end. Perfmatters and WP Rocket include the same control.

Can I slow down Heartbeat without a plugin?

Yes. Add a filter on heartbeat_settings that sets the interval to 60 seconds, in a child theme or a site-specific plugin. The working range is 15 to 60 seconds, and 60 is the slowest value WordPress accepts.

What breaks if I disable Heartbeat completely?

Autosave stops, post locking stops, and login expiry warnings stop. Two editors can open the same post with no warning, and the last save wins. Slow Heartbeat to 60 seconds first, and disable it only where no editor works.

How do I know my Heartbeat change worked?

Open the post editor and watch for the autosave note, then open the same post in a second browser to check the lock warning. Also watch admin-ajax.php traffic in your host stats for a day; it should fall during work hours.

Is slowing down Heartbeat a security risk?

No. Heartbeat is not a security feature, and slowing it does not open the site to attack. It only changes how often the browser checks in with the server. Keep WordPress, plugins and themes updated for security instead.

Sources

  1. Heartbeat API WordPress Developer Resources
  2. wp_heartbeat_settings() WordPress Developer Resources
  3. Heartbeat Controller WordPress.org
  4. How to change the Heartbeat frequency in WordPress Perfmatters
  5. How to Limit the WordPress Heartbeat API? ScalaHosting
  6. WordPress Heartbeat: What it is and how to use it SolidWP

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

WPLegible editors

Researched from the primary sources listed above and checked against our editorial rules. About the site · How we test