WordPress Heartbeat and how to configure it

The WordPress Heartbeat API allows WordPress to communicate between the web browser and your server. It’s serves as a continuous “pulse” or “tick” that is used to perform periodic tasks. The Heartbeat API is used to communicate with your server during ajax calls and sync real-time information – such as log file data – between the server and the WordPress dashboard.

The Heartbeat API sends ajax requests to the server using a core administration file called admin-ajax.php. Depending on activity, a large number of requests can be sent to your hosting server, resulting in high CPU utilization, a reduction in page speed and, potentially, interruption of your service.

If you notice performance issues resulting from a high CPU utilization, tweaking the configuration of the WordPress Heartbeat API may help.

Log in to your WordPress administration dashboard and, using the left sidebar, navigate to Plugins > Add New.

WordPress Plugins

Search for Heartbeat Control, then install and activate the plugin from the list of results.

Heartbeat Control plugin

In the left sidebar, click Settings > Heartbeat Control Settings, to configure the plugin.

Heartbeat Control Settings menu

The Heartbeat Control plugin allows you to create one or more rules to modify how the WordPress Heartbeat API works. This includes the ability to fully disable the API. Bear in mind that the API is used for a variety of functions (for example, allowing only one author to edit a post at a time) alongside a range of under the hood features that will be disabled if you switch off the API.

Heartbeat Control settings

Rules are prioritized by the order they appear on screen. Rules nearer the top of the screen take priority over those below.

Under Rule 1, first click the Heartbeat Behaviour dropdown menu to Allow, Disable or Modify Heartbeat.

Behavior dropdown menu

In this example, we’ll select Modify Heartbeat.

Below, checkboxes next to Locations allow you to target the rule to specific areas of WordPress. The WordPress Dashboard, Frontend and Post Editor are available for selection, or you can click the Select/Deselect All button to toggle the selection of all locations.

Locations setting

Click and drag the Frequency slider to a value of your choosing (in seconds). Moving the slider all the way to the right will delay the Heartbeat for 5 minutes (300 seconds). You may need to fine tune the Frequency after the rule has been created, to achieve a balance between performance and functionality.

Frequency slider

Click Save Changes to complete configuration or Add Another Rule to continue tweaking Heartbeat settings. The arrows at the bottom of the screen allow you to change priority of rules in the list.

For further questions, or if you need help, please open a support ticket from your HostPapa Dashboard. Follow this link to learn how.

This article is also available in: French Spanish German

Was this article helpful?

Related Articles

Leave A Comment?