The WordPress Heartbeat API fires AJAX requests to the server regularly — every 15 seconds in the post editor and every 60 seconds on the dashboard. On shared hosting or busy sites, this background activity impacts performance.

Why This Matters

Heartbeat powers useful features:

  • Auto-save — periodically saves your work in the post editor
  • Post locking — prevents two users from editing the same post
  • Dashboard notifications — updates like incoming comments

But it also puts constant load on your server, especially if multiple users are logged in. Each heartbeat is a full admin-ajax.php request.

How to Fix It

Safe Practice: Before making any technical changes, ensure you have a full backup of your site (files and database) via your hosting control panel or a dedicated plugin like UpdraftPlus.

Method 1: mu-plugin (Recommended)

Create a file at wp-content/mu-plugins/heartbeat-control.php:

<?php
/**
 * Plugin Name: Dravasite – Heartbeat Control
 * Description: Reduces the WordPress Heartbeat API frequency from 15s to 120s.
 *              Keeps auto-save and post locking working, just less aggressively.
 * Version:     1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

// Slow down Heartbeat from 15s to 120s (2 minutes)
add_filter( 'heartbeat_settings', function ( $settings ) {
    $settings['interval'] = 120;
    return $settings;
} );

To also disable Heartbeat entirely on the dashboard (keep it in the post editor for auto-save):

// Disable Heartbeat everywhere except the post editor
add_action( 'init', function () {
    if ( ! is_admin() ) {
        return;
    }

    global $pagenow;

    // Keep Heartbeat on post edit screens for auto-save
    if ( $pagenow !== 'post.php' && $pagenow !== 'post-new.php' ) {
        wp_deregister_script( 'heartbeat' );
    }
} );

New to mu-plugins? Read our guide to adding code snippets safely with mu-plugins — it takes 2 minutes to set up and survives theme updates.

Method 2: Using a Plugin

  • Heartbeat Control — simple settings to change frequency per location
  • Perfmatters — includes Heartbeat control in its performance settings
  • WP Rocket — has a Heartbeat control add-on

What to Watch For

  • Don't disable Heartbeat in the post editor if multiple people publish content — you'll lose auto-save and post locking.
  • Setting the interval too high (300+ seconds) means auto-saves happen rarely. If your browser crashes, you lose more unsaved work.
  • This matters most on shared hosting. On fast dedicated servers or managed WordPress hosting, the impact is minimal.
  • 120 seconds is a good balance between performance and functionality.