Use code PERFMATTERS for an extra 10% off!
  1. Home
  2. Docs
  3. General
  4. How to disable the WordPress Heartbeat API

How to disable the WordPress Heartbeat API

The WordPress Heartbeat API uses /wp-admin/admin-ajax.php to run AJAX calls from the web browser. While this is great and all it can also cause high CPU usage and crazy amounts of PHP calls. For example, if you leave your dashboard open it will keep sending POST requests to this file on a regular interval, every 15 seconds.

Here is an example below of it happening.

Admin-ajax requests in logs
Admin-ajax requests in logs

Disable the Heartbeat API

Follow the steps below to disable the Heartbeat API and or modify where you want it to run.

Step 1

Click into the Perfmatters plugin settings.

Perfmatters plugin settings
Perfmatters plugin settings

Step 2

Make sure you’re on the “General” submenu.

Perfmatters General submenu
Perfmatters General submenu

Step 3

Scroll down and choose an option under “Disable Heartbeat.”

There are three options built into the plugin to help minimize this:

  1. Leave as default
  2. Disable everywhere
  3. Only Allow When Editing Posts/Pages

We recommend the last one and that is the setting we use on our sites. This will drastically decrease the number of requests.

Disable Heartbeat API with Perfmatters plugin
Disable Heartbeat API with Perfmatters plugin

Step 4

Scroll down and click “Save Changes.”

Troubleshooting

If you are using a page builder plugin like Elementor, you will want to use the third option above. Disabling Heartbeat everywhere will sometimes cause problems with page builders’ functionality.

Make sure to also check out our other option to change the Heartbeat API frequency.

Was this article helpful?

Related Articles