How can I view and monitor the frequency of WordPress Heartbeat activity?

WordPress The Heartbeat API is responsible for the backendautosave,Edit Lockrespond in singingsession holdHowever, frequent requests can also slow down a website, especially if you have high traffic or are using shared hosting. In this article, we'll look at a few simple ways to see how often Heartbeat is being requested, and we'll offer practical optimization tips to help you reduce your resource footprint and improve your site's performance.

Image [1] - How to View & Optimize WordPress Heartbeat Request Frequency

I. What is WordPress Heartbeat API?

Heartbeat supports both browsers and serversRegular communications. Common application scenarios include:

  • Automatic saving of draft articles
  • Lockout tips for multi-user collaboration
  • Session hold prevents background timeout
  • Real-time display of plugin notifications or status updates

Its essence is that by regularly initiating AJAX request (default every 15 seconds) to "keep in touch" with the server.

How to check Heartbeat activity frequency?

Viewing Requests Using Browser Developer Tools

  1. log in WordPress Backend
  2. Open browser developer tools (shortcut F12 or right click to inspect element)
  3. Switch to "Network(Network)" tab
  4. Select in the filterFetch/ XHRThe AJAX request type is
  5. Observe if there is a file named /wp-admin/admin-ajax.php The request is periodically refreshed by the

These requests that carry action=heartbeat parameter, which is the communication activity of the Heartbeat API. You can observe how often it initiates requests to estimate the frequency.

Image [2] - How to View & Optimize WordPress Heartbeat Request Frequency

Third, how to monitor and control the frequency of Heartbeat?

If you find that Heartbeat requests are too frequent, you can use a plugin toAdjust the frequency or limit its range of motionThe

Recommended Plugin: Heartbeat Control

  • Plugin Address:WordPress PluginLibrary Direct Search "Heartbeat Control"
  • After the installation is enabled, go to Settings → Heartbeat Control
  • You can:
    • Disable Heartbeat for specific areas (e.g. post edit pages, dashboards)
    • Adjust the frequency (recommended setting is 60 seconds.)
    • Completely disabled (not recommended unless the specific impact is well understood)
Image [3] - How to View & Optimize WordPress Heartbeat Request Frequency

When do I need to restrict Heartbeat?

The Heartbeat feature itself has the advantage of real-time communication, but optimization is recommended in the following scenarios where wasted resources can be avoided:

  • using shared hosting.Requests for Frequent RequestsEasily exceeds resource constraints
  • Multiple editing pages open in the background lead tohigh-frequency communications
  • nodehigh volume of visitorsServer High CPU utilization
  • appeared admin-ajax.php requestingTimeouts, lag, CPU usage spikesand so on

If you are experiencing these problems, by limiting the Heartbeat The range and frequency of invocations can significantly reduce server stress.

V. Optimization recommendations and additional clarifications

Image [4] - How to View & Optimize WordPress Heartbeat Request Frequency
  • It is recommended to set the Heartbeat interval to 30-60 secondsBetween the two, it is possible to balance performance and real-time
  • Avoid turning off Heartbeat completely, as this will affect features such as post auto-save, login status retention, etc.
  • In conjunction with a caching plugin (such as WP Super Cache,W3 Total Cache) to further enhance performance
  • With page builders such as Elementor, do not disable Heartbeat on editor pages to prevent the saving mechanism from being affected!

VI. Summary

WordPress' Heartbeat API is useful, but frequent requests can impact performance. Its frequency of activity can be viewed through the browser and can be flexibly controlled using a plugin. For sites with limited resources, properly optimizing Heartbeat is an easy way to improve efficiency.


Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
Customer Service
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: info@361sale.com
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
This article was written by Toast
THE END
If you like it, support it.
kudos579 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments