How to Safely Disable the WordPress Heartbeat API for Better Performance

XeroWP Aug 13, 2026 6 min read
How to Safely Disable the WordPress Heartbeat API for Better Performance

Introduction: The Silent CPU Killer in Your WordPress Admin

Have you ever noticed your WordPress dashboard becoming inexplicably sluggish while you are writing a post? Or perhaps your hosting provider has sent you a warning about exceeding CPU limits, even though your site traffic seems normal. One of the most common, yet overlooked, culprits behind these performance bottlenecks is the WordPress Heartbeat API.

Introduced in WordPress 3.6, the Heartbeat API is a powerful tool that allows WordPress to communicate between the browser and the server in real-time. While it enables essential features like autosaving and post-locking, it can also create a massive amount of overhead on your server. In this guide, we will explore what the Heartbeat API does, why it might be slowing you down, and how you can safely disable or throttle it to keep your XeroWP-hosted site running at peak efficiency.

What is the WordPress Heartbeat API?

The Heartbeat API uses a protocol called AJAX polling. Essentially, your web browser sends periodic requests (the "heartbeat") to the server using the admin-ajax.php file. The server then processes these requests and sends back data.

This happens automatically without you needing to refresh the page. Here are the primary functions it handles:

  • Autosaving: Periodically saving your drafts as you write so you don't lose work if your browser crashes.
  • Post Locking: Preventing two users from editing the same post simultaneously by showing a warning that another user is currently working on it.
  • Real-time Notifications: Displaying notifications from plugins (like e-commerce sales or security alerts) directly in the admin bar.
  • Session Management: Keeping your login session active so you aren't suddenly logged out while working.

The Problem: Why High Frequency Polling Hurts Performance

The issue isn't that the Heartbeat API exists; it's how often it beats. By default, the API sends a request every 15 seconds on post-edit screens and every 60 seconds on the rest of the dashboard.

While a single request is lightweight, consider these scenarios:

  1. Multiple Tabs Open: If you have five different admin tabs open (e.g., your dashboard, your posts list, and three post editors), your browser is sending a request every few seconds.
  2. Multiple Users: If you have a team of editors all working at the same time, the number of requests to admin-ajax.php scales exponentially.
  3. Shared or Limited Resources: On lower-tier hosting environments, these constant PHP executions can consume all available CPU cycles, leading to a 504 Gateway Timeout or a slow, frustrating editing experience.

At XeroWP, our managed infrastructure is designed to handle high-concurrency tasks, but even the best servers benefit from reducing unnecessary background noise. Optimizing the Heartbeat API is a "quick win" for any WordPress site owner.

How to Monitor Heartbeat API Activity

Before you disable it, you should see it in action. You can monitor these requests using your browser's Developer Tools:

  1. Open your WordPress dashboard and right-click anywhere to select Inspect.
  2. Navigate to the Network tab.
  3. Filter the results by searching for admin-ajax.php.
  4. Wait for a minute. You will see new entries appear automatically as the browser "pulses."

If you see dozens of these requests firing while you are just sitting on the dashboard, it is time to optimize.

Option 1: Managing Heartbeat with a Plugin (Recommended)

For most users, the safest and easiest way to control the Heartbeat API is by using the Heartbeat Control plugin by WP Rocket. This plugin gives you a graphical interface to disable or frequency-cap the API across different areas of your site.

Steps to Configure Heartbeat Control:

  1. Install and activate the Heartbeat Control plugin from the WordPress repository.
  2. Navigate to Settings > Heartbeat Control.
  3. You will see three categories: WordPress Dashboard, Frontend, and Post Editor.
  4. For each category, you have three choices: "Allow Heartbeat," "Disable Heartbeat," or "Modify Heartbeat."

Pro Tip: We recommend disabling Heartbeat on the Frontend and Dashboard, but choosing Modify Heartbeat for the Post Editor. Set the frequency to 60 or 120 seconds. This allows you to keep the autosave feature while significantly reducing the load on your server.

Option 2: Disabling Heartbeat with Code

If you prefer to keep your site lean and avoid adding another plugin, you can disable the Heartbeat API by adding a small snippet of code to your theme's functions.php file or a site-specific plugin.

To Disable Heartbeat Everywhere:

Use this snippet to completely stop the API. Warning: This will disable autosaving and post-locking.

add_action( 'init', 'stop_heartbeat', 1 );
function stop_heartbeat() {
    wp_deregister_script('heartbeat');
}

To Disable Heartbeat Only on Specific Pages:

Often, you only want to stop the Heartbeat on the dashboard or frontend while keeping it active in the editor. You can use this more surgical approach:

add_action( 'init', 'smart_heartbeat_limit', 1 );
function smart_heartbeat_limit() {
    global $pagenow;
    if ( $pagenow != 'post.php' && $pagenow != 'post-new.php' ) {
        wp_deregister_script('heartbeat');
    }
}

When Should You NOT Disable the Heartbeat API?

While disabling the API can save resources, it isn't always the right choice. Do not disable it if:

  • You have a multi-author blog: Without the Heartbeat API, WordPress won't know if two people are editing the same post, leading to overwritten content and lost work.
  • You rely on real-time plugin data: Some plugins, like WooCommerce, use the API to update sales stats on the dashboard in real-time. Disabling it will make these stats static until you refresh the page.
  • You are prone to losing work: If you frequently lose your internet connection or your browser crashes, the autosave feature (powered by Heartbeat) is a lifesaver.

In these cases, throttling the API (changing the interval to 60 or 120 seconds) is a much better middle ground than disabling it entirely.

Conclusion: A Faster Admin for a Faster Workflow

Optimizing the WordPress Heartbeat API is a critical step in professional WordPress maintenance. By reducing the frequency of admin-ajax.php calls, you free up server resources for your visitors and ensure your admin dashboard remains snappy and responsive. Whether you use a plugin like Heartbeat Control or a custom code snippet, taking control of your site's internal pulse is a hallmark of a well-managed site.

At XeroWP, we believe performance should be built-in. Our managed WordPress hosting is optimized at the server level to handle complex tasks, but fine-tuning your WordPress configuration ensures you get the most out of our high-speed infrastructure. Ready to experience a faster WordPress? Move your site to XeroWP today and let us handle the heavy lifting for you.", "tags": ["wordpress-performance", "server-optimization", "wordpress-admin", "backend-speed"], "image_search_query": "modern server room"}