◦ Comprehensive security
◦ 24/7 support
WordPress Guide → Development → WordPress Heartbeat
WordPress Heartbeat: What it is and how to use it
If you’ve ever been surprised by how WordPress autosaves your drafts or locks a post when someone else is editing, you’re already seeing the Heartbeat API in action. But while it brings helpful features, it can also drain server resources if left unmanaged.
Let’s look at what the WordPress Heartbeat API actually does, where it runs, and how to control it for better performance.
Get fast, reliable hosting for WordPress
Power your site with the industry’s fastest, most optimized WordPress hosting
What is the WordPress Heartbeat API?
The WordPress Heartbeat API is a built-in feature, introduced in WordPress 3.6, that enables real-time communication between your browser and the server using Ajax calls. These short, frequent messages let your site perform background tasks like autosaving, post locking, and syncing data with plugins.
It gets its name from how it works—sending out a “pulse” every few seconds to check in with the server.
What does the Heartbeat API do?
The Heartbeat API powers several key features inside the WordPress admin area:
- Autosaves posts and pages while you’re editing.
- Shows when another user is editing the same content to prevent overwriting.
- Manages session timeouts and login prompts.
- Supports plugins that need real-time updates or activity tracking.
This makes it a quiet but essential part of how WordPress works behind the scenes.
Where and how often does WordPress Heartbeat run?
The API is active mainly in the WordPress admin area, and the frequency depends on where it’s running:
- On the post editor screen: Sends requests every 15 seconds.
- On other admin screens: Sends requests every 60 seconds.
Each of these pulses hits admin-ajax.php, which increases the load on your server. On low-resource hosting plans, this can cause high CPU usage or even timeout errors if multiple users are active.
Pros and cons of the Heartbeat API
It’s always a balance.
Pros:
- Prevents content loss by autosaving your work.
- Helps teams avoid editing conflicts with post locking.
- Enables real-time features in certain themes and plugins.
Cons:
- Can spike server resource usage, especially on shared hosting.
- Adds background traffic that may affect performance.
- May cause high usage warnings from some hosting providers.
How to control or disable the WordPress Heartbeat API
If you’re seeing performance issues or just want more control, you can manage the Heartbeat API with or without code.
Use a plugin (recommended)
The best way to manage the Heartbeat API without touching code is with WPCode. It’s a powerful plugin that lets you add custom PHP snippets safely and easily—no need to edit your theme files.
With WPCode, you can:
- Control where the Heartbeat API runs (dashboard, post editor, frontend)
- Adjust the frequency of Heartbeat requests
- Disable it entirely in specific areas to reduce server load
Control it manually via code
If you’re comfortable editing your theme’s functions.php or using a code snippet plugin, you can manage Heartbeat manually.
Change Heartbeat frequency:
add_filter( ‘heartbeat_settings’, ‘custom_heartbeat_frequency’ );
function custom_heartbeat_frequency( $settings ) {
$settings[‘interval’] = 60; // seconds
return $settings;
}
Disable Heartbeat in the dashboard:
add_action( ‘init’, ‘stop_heartbeat’, 1 );
function stop_heartbeat() {
if (is_admin()) {
wp_deregister_script(‘heartbeat’);
}
}
Use these carefully—disabling Heartbeat entirely can break autosave and post locking.
When should you disable or modify the Heartbeat API?
Some common use cases for tweaking or limiting Heartbeat:
- On shared hosting: Reduce frequency or disable in the dashboard to lower resource use.
- Solo blogging: Disable in the post editor if you don’t need post locking or autosaves.
- WooCommerce or real-time plugins: Leave Heartbeat enabled but reduce frequency instead.
Always test changes before deploying them on a live site.
Tips for optimizing Heartbeat without turning it off
If you want to keep the benefits without the resource hit:
- Limit activity to post edit screens only
- Reduce the frequency of requests to 60 seconds or higher
- Use caching plugins or a performance-focused host
- Monitor admin-ajax.php using tools like Query Monitor
Advanced usage: developers and Heartbeat custom events
If you’re a developer or running custom functionality, the Heartbeat API supports custom data events:
- Use wp.heartbeat.send to push data to the server.
- Use wp.heartbeat.tick to receive data back.
This opens up use cases like live analytics, real-time chat, or collaborative editing. Just be cautious with frequency and payload size to avoid performance issues.
Getting started with the WordPress Heartbeat API
Understanding how the WordPress Heartbeat API works can help you avoid performance issues and make better decisions about your site’s backend behavior.
If you’re experiencing slow dashboards or hitting server limits, it’s time to take control—whether that means reducing the frequency, disabling it in specific areas, or using a plugin to manage it with no code.
Ready to upgrade your WordPress experience? Professional hosting improves speeds, security, and reliability for a website and a brand that people find engaging and trustworthy. Liquid Web’s WordPress hosting options configure business-class servers and support plans specifically for WordPress websites.
Don’t want to deal with server management and maintenance? Our fully managed hosting for WordPress is the best in the industry. Our team are not only server IT experts, but WordPress hosting experts as well. Your server couldn’t be in better hands.
Click through below to explore all of our hosting for WordPress options, or chat with a WordPress expert right now to get answers and advice.
Additional resources
What is managed WordPress hosting? →
Get details and decide if managed WordPress hosting is right for you.
How to install WordPress with Nginx →
Learn how to install and configure WordPress with NGINX for improved performance and flexibility.
A complete guide to WordPress shortcodes →
Shortcodes make life easier. Learn how to get started!