{"id":8082,"date":"2026-05-10T15:06:07","date_gmt":"2026-05-10T13:06:07","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=8082"},"modified":"2026-05-10T15:06:08","modified_gmt":"2026-05-10T13:06:08","slug":"intelegerea-si-optimizarea-wordpress-heartbeat","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/ro\/knowledgebase\/understanding-and-optimizing-wordpress-heartbeat\/","title":{"rendered":"\u00cen\u021belegerea \u0219i optimizarea WordPress Heartbeat"},"content":{"rendered":"<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">The <strong>WordPress Heartbeat API<\/strong> is a built-in feature introduced in version 3.6 that acts as a communication bridge between your web browser and your <strong>mybox-hosted<\/strong> server. It functions like a pulse, sending periodic &#8220;ticks&#8221; (AJAX requests) to the server to perform background tasks without requiring a full page refresh.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While highly functional, this constant pulsing can sometimes place an unnecessary load on your server&#8217;s CPU, especially if you have multiple administrative tabs open simultaneously.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/understanding-and-optimizing-wordpress-heartbeat\/#What_Does_the_Heartbeat_API_Do\" >What Does the Heartbeat API Do?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/understanding-and-optimizing-wordpress-heartbeat\/#The_Performance_Impact_on_Your_mybox_Server\" >The Performance Impact on Your mybox Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/understanding-and-optimizing-wordpress-heartbeat\/#How_to_Optimize_Heartbeat\" >How to Optimize Heartbeat<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/understanding-and-optimizing-wordpress-heartbeat\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Does_the_Heartbeat_API_Do\"><\/span>What Does the Heartbeat API Do?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<\/div>\n\n<div id=\"mybox-2483034010\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Acces timpuriu<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Mai ave\u021bi nevoie de ajutor?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contacta\u021bi echipa noastr\u0103 de servicii pentru clien\u021bi.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Trimite mesaj<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">The Heartbeat API is responsible for several real-time features that improve the editing experience:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Autosave:<\/strong> Periodically saves your drafts while you are writing, preventing data loss if your browser crashes or your connection drops.<\/li>\n\n\n\n<li><strong>Post Locking:<\/strong> In a collaborative environment, it alerts you if another user is currently editing the same post, preventing you from overwriting each other&#8217;s work.<\/li>\n\n\n\n<li><strong>Real-time Notifications:<\/strong> Some plugins use it to show live sales data, security alerts, or e-commerce updates directly in the dashboard.<\/li>\n\n\n\n<li><strong>Session Management:<\/strong> Monitors your login status and warns you if your session is about to expire.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Performance_Impact_on_Your_mybox_Server\"><\/span>The Performance Impact on Your mybox Server<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Every &#8220;tick&#8221; of the Heartbeat API sends a POST request to the <code>admin-ajax.php<\/code> file.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Default Pulse:<\/strong> By default, it &#8220;ticks&#8221; every <strong>15 seconds<\/strong> in the post editor and every <strong>60 seconds<\/strong> on the main dashboard.<\/li>\n\n\n\n<li><strong>The Resource Drain:<\/strong> Each request requires the server to process PHP code. If you have five tabs open, your browser is hitting the server dozens of times per minute. On high-traffic or resource-limited sites, this can lead to high CPU usage and slower overall performance.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Optimize_Heartbeat\"><\/span>How to Optimize Heartbeat<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#8217;t necessarily need to disable Heartbeat entirely, as you would lose valuable features like autosave. Instead, you should &#8220;throttle&#8221; or manage it based on where it&#8217;s needed most.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. Using a Plugin (The Easiest Method)<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Plugins like <strong>Heartbeat Control<\/strong> or the optimization settings in <strong>WP Rocket<\/strong> allow you to manage the pulse without code.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Dashboard:<\/strong> You can usually disable Heartbeat here entirely or reduce it to once every 2 minutes.<\/li>\n\n\n\n<li><strong>Post Editor:<\/strong> It is a mechanical necessity to keep this active, but you can increase the interval from 15 seconds to 60 seconds.<\/li>\n\n\n\n<li><strong>Frontend:<\/strong> Unless you have a specific plugin that requires live updates for visitors, it is best to <strong>disable<\/strong> Heartbeat on the frontend.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">2. Manual Optimization via functions.php<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If you prefer not to use a plugin, you can add a snippet to your theme&#8217;s <code>functions.php<\/code> file to change the interval to the maximum allowed (60 seconds):<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PHP<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'heartbeat_settings', function ( $settings ) {\n    $settings&#91;'interval'] = 60; \/\/ Set to 60 seconds\n    return $settings;\n} );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To disable it entirely on the frontend (where it is rarely needed):<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PHP<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_action( 'init', function () {\n    if ( ! is_admin() ) {\n        wp_deregister_script( 'heartbeat' );\n    }\n} );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Optimizing the WordPress Heartbeat is a simple yet effective way to preserve your <strong>mybox-hosted<\/strong> server resources. By reducing the frequency of background requests, you ensure that your CPU power is focused on serving content to your visitors rather than managing administrative background noise. After making these changes, you can monitor your <code>admin-ajax.php<\/code> activity in your <strong>mybox panel<\/strong> logs to see the immediate reduction in server load.<\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[58],"manual_kb_tag":[8517,8518,1774,8519,2273,2433,2823,5562,8508,8509,8510,8511,8512,8513,8514,8515,8516],"class_list":["post-8082","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-web-applications-cms","manual_kb_tag-server-load-reduction","manual_kb_tag-admin-ajax-requests","manual_kb_tag-session-management","manual_kb_tag-background-server-requests","manual_kb_tag-heartbeat-control","manual_kb_tag-mybox-hosting","manual_kb_tag-admin-ajax","manual_kb_tag-wordpress-performance","manual_kb_tag-wordpress-heartbeat","manual_kb_tag-heartbeat-api","manual_kb_tag-heartbeat-optimization","manual_kb_tag-throttle-heartbeat","manual_kb_tag-disable-heartbeat","manual_kb_tag-autosave","manual_kb_tag-post-locking","manual_kb_tag-reduce-heartbeat-frequency","manual_kb_tag-heartbeat-control-plugin"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/8082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/8082\/revisions"}],"predecessor-version":[{"id":8083,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/8082\/revisions\/8083"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/media?parent=8082"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manualknowledgebasecat?post=8082"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb_tag?post=8082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}