SKR Tips logo SKR TipsWebsite tips that actually work
WordPress

WordPress Heartbeat API and Why wp-admin Feels Slow

Patch day on our wiki used to look like this. Four volunteer editors open the block editor at roughly the same time, each with a long guide draft, and within twenty minutes the dashboard starts crawling.

Browser network panel showing repeated admin-ajax requests beside an open WordPress block editor draft

Patch day on our wiki used to look like this. Four volunteer editors open the block editor at roughly the same time, each with a long guide draft, and within twenty minutes the dashboard starts crawling. Saving a draft takes eight or nine seconds. The host sends an email about sustained CPU use. The front end, meanwhile, is perfectly fine for readers, which makes the whole thing look like a mystery rather than a measurable problem.

It was not a mystery. It was the Heartbeat API, doing exactly what it was built to do, multiplied by four people sitting in the editor for an hour. Front end speed guides do not cover this because none of it happens on the front end. If your fan site feels sluggish only when you are logged in and working, this is the first place to look, and it takes about ten minutes to confirm.

What the Heartbeat API is actually doing

WordPress needs a way for an open browser tab to talk to the server without you clicking anything. Autosave needs it. So does the lock that stops two editors overwriting the same guide, the little notice that says someone else is editing this post, the session expiry warning, and plenty of plugin features such as order counters in a shop dashboard.

The mechanism is a scheduled POST request to admin-ajax.php. In the post editor it fires every 15 seconds by default. Elsewhere in wp-admin it settles to roughly every 60 seconds, and WordPress slows it further after a few minutes of no activity in the tab. Each request loads WordPress, runs any hooks plugins have attached to the heartbeat, and returns a small JSON response.

One editor at 15 second intervals is four requests a minute. That is nothing. Four editors across a two hour patch note session is roughly 1,900 full WordPress loads, and on the kind of shared plan a volunteer run community actually pays for, that is enough to hit a CPU allowance. Our host measured it in CPU seconds per hour and we were burning the monthly figure in about four days every patch cycle.

Check your own numbers before changing anything

Do not take my word for the scale of it on your site, because it depends entirely on how many plugins have hooked into the heartbeat. Two checks tell you nearly everything.

The first is the access log, available in cPanel under raw logs or from your host's dashboard. Search it for admin-ajax.php and count the lines for a single busy day. On our wiki that number was 11,400 for one Thursday, against about 6,800 front end page views. The admin was generating more server work than the readers.

The second is the browser network tab. Open a draft guide, filter requests by admin-ajax, and watch for two minutes. You should see a request every 15 seconds and each response should be small, usually under 2 KB and finishing in a couple of hundred milliseconds. If a single heartbeat response takes 1.5 seconds or returns 40 KB, a plugin is doing real work inside it, and that plugin is your actual problem rather than the heartbeat itself. We found a membership plugin recalculating rank badges on every beat.

Turning it off completely is the advice you will see, and it is wrong

Search for this problem and the top answers all tell you to drop a line into functions.php that deregisters the heartbeat script, which kills it everywhere. It works. It is also the change I regret most out of everything I have done to that site.

Without the heartbeat, post locking stops functioning. Two editors can open the same boss guide, both write for half an hour, and the second one to save silently discards the first one's work with no warning and no notice in the editor. We lost about 2,000 words of a raid guide that way in 2024, written by a volunteer on a Sunday evening, and I had no honest answer for him beyond admitting I had broken it to save CPU.

Autosave goes with it too. On a community site where people draft in the editor rather than a text file, that matters more than any speed gain. The browser crashes, the laptop sleeps, and there is no recovery copy because nothing was talking to the server.

The useful change is not off, it is slower. Fifteen seconds was chosen for a newsroom where several staff edit the same breaking story. A wiki where two people touch the same page twice a month does not need that resolution.

The settings that work on a volunteer site

WhereDefault intervalWhat it powers thereWhat I set it to
Post editor15 secondsAutosave, post locking, the editing notice60 seconds, kept on
Dashboard home and admin pagesAbout 60 secondsSession warnings, plugin counters, activity widgetsDisabled
Front end while logged inOnly if a plugin enables itUsually a shop or membership featureDisabled

Two ways to get there. The plugin route is Heartbeat Control, which gives you exactly those three locations as dropdowns and takes two minutes. It is the right answer if nobody on your team edits code, and I run it on the wiki rather than my own snippet, because a plugin with a settings screen survives me handing the site to someone else.

The code route is the heartbeat settings filter in a small site specific plugin, where you return an interval in seconds. The accepted band is 15 to 120 seconds and values outside it get pulled back inside, so asking for 600 will not do what you expect. Put it in a site specific plugin rather than the theme, for the same reason you would use a clean method for isolating plugin problems: you want to be able to switch one thing off without touching the theme.

While you are in wp-config.php, consider the autosave interval, which is a separate constant defaulting to 60 seconds. Raising it to 120 pairs sensibly with a 60 second heartbeat. Do not raise it past about 180 on a site where volunteers write long guides in the browser. The point of these changes is fewer requests, not fewer safety nets.

One more thing to check before you blame any of this. If your scheduled patch notes also miss their publish time, you may have a separate issue with how WordPress runs timed tasks, which we covered in the guide to fixing missed scheduled posts. The two problems feel similar from the admin side and have nothing to do with each other.

What actually changed after

Our admin-ajax line count went from 11,400 on a patch Thursday to roughly 2,900. Draft saves dropped from the eight or nine seconds that started this to under two. The host stopped emailing. Post locking still works, which I now test deliberately every few months by opening the same draft in two browsers and checking that the second one warns me.

What did not change: front end speed, scores in any testing tool, and anything a reader experiences. If you are hoping this fixes a slow public page, it will not. It fixes the site for the handful of people who actually keep it running, which on a volunteer project is worth more than it sounds.

FAQ

Will slowing the heartbeat break autosave?

No, it just saves less often. At a 60 second heartbeat you lose at most a minute of typing in a crash instead of fifteen seconds. Every editor I have asked considers that an acceptable trade for an editor that responds immediately.

How do I find which plugin is making each beat expensive?

Watch the response size in the browser network tab, then deactivate suspects one at a time on a staging copy and watch the size again. A query monitoring plugin will also show you the hooks attached to the heartbeat action, which is faster if you are comfortable reading that output.

Does any of this matter on managed WordPress hosting?

Less, because object caching and more generous CPU allowances absorb it. It still matters if your plan is metered by requests or visits, since some hosts count admin-ajax calls toward your allowance. Worth reading your plan's definition of a visit before assuming you are safe.

Is there a way to see this without installing anything?

Yes, the browser network tab plus your raw access log covers it. Neither requires a plugin and both show real numbers from your own site, which beats any general figure I can give you here.

MO
Matthias Okeke

Matthias ran a clan website and a fan wiki for years before writing about them. He covers the sites gaming communities build, from guides to patch note pages.

More posts by Matthias

More in WordPress