The WordPress Heartbeat API uses /wp-admin/admin-ajax.php to run AJAX calls from the web-browser. Which in theory sounds awesome, as WordPress can keep track of what's going on in the dashboard.
However this can also start sending excessive requests to admin-ajax.php which can lead to high CPU usage. Anytime a web-browser is left open on a page using the Heartbeat API, this could potentially be an issue.
WordPress Heartbeat API in action
Something handled by the WordPress Heartbeat API is the main WordPress admin dashboard page itself. If all you did was login to WordPress and then minimized that window and started working on something else, you'd see requests for admin-ajax.php in your site's access logs.
At [00:29:30] I logged into the dashboard, and you can see the initial GET /wp-admin/index.php request.
Then at [00:30:31] the WordPress Heartbeat API sends a POST /wp-admin/admin-ajax.php Heartbeat request.
With the WordPress dashboard in focus, a Heartbeat request should be spaced the max of 60 seconds that the API allows for. If the dashboard is out of focus, the Heartbeat requests space out to 120 seconds between them.
Disable WordPress Heartbeat API
If you notice that you are having an excessive amount of admin-ajax.php requests, the WordPress Heartbeat API can be disabled to prevent this type of activity from happening automatically.
Installing the Heartbeat Control plugin
-
First, log into your WordPress admin dashboard.
Within your dashboard, hover over Plugins and click on Add New. -
On this page, enter Heartbeat Control into the search box At the top and press the Enter key on your keyboard to perform the search.
You can find the plugin as Mention in screenshot below
- As you have searched for the exact name of the plugin, it should be the first result that appears. To install it, click on the Install Now button.
- WordPress will now handle the download and installation of the Heartbeat Control plugin. Of course, be sure to click on Activate Plugin when complete.