Knowledge Base
MilesWeb / WordPress FAQ

How To Set Frequency Of WordPress Heartbeat And Limit Executions?

Approx. read time : 2 min

The WordPress 3.6 version launched the WordPress Heartbeat API. WordPress Heartbeat API enables the communication of your browser and the server while you are logged into the WordPress admin panel. This feature enables WordPress to manage various aspects like letting the other author know that a particular post is being edited by some other user, the plugins can also use the script executions and thereby you can get notifications in real time etc.

Even though the WordPress Heartbeat API looks like a great feature, it might cause some issues in some situations. The Heartbeat makes checks at different time periods on different pages of your website – like for the post edits, it makes a check in every 15 minutes and on the Dashboard, the check is made every minute etc. Every ‘tick’ made by the Heartbeat creates a POST request that adds to the number of your executions and it also adds to the CPU time used.

The WordPress Heartbeat feature makes use of the wp-admin/admin-ajaz.php file in order to make the AJAX calls. If you notice that a large number of POST requests are generated by that file, it means that you have to limit the work of Heartbeat or you need to stop it completely.

How To Limit Heartbeat?

It is possible to limit the execution frequency of WordPress Heartbeat. This can be done by making use of a plugin known as ‘Heartbeat Control’.

  • Install the Heartbeat Control plugin and activate it
  • Now go to ‘Settings’ and click on ‘Heartbeat Control Settings’
  • From the ‘Heartbeat Behavior’ drop down menu, select ‘Modify Heartbeat’
  • Select all the ‘Locations’
  • From the ‘Frequency’ slider, select 60 or above
  • Save the settings

When the settings are saved, you will override the Heartbeat execution frequency that is set by default. The frequency will be set to the value that you set through the Frequency slider.

How To Disable Heartbeat?

You can disable WordPress Heartbeat by selecting the option ‘Disable Heartbeat’ from the ‘Heartbeat Behavior’ drop down menu and enable all the ‘Locations’. This will disable the use of Heartbeat feature on all the pages of your website.

How To Stop Heartbeat Completely?

If you no longer wish to work with the WordPress Heartbeat feature, you can stop it completely. For doing this, you have to edit the ‘functions.php’ file of your theme and paste the lines mentioned below right after opening the ‘<?php’ tag:

add_action( ‘init’, ‘stop_heartbeat’, 1 );

function stop_heartbeat() {

wp_deregister_script(‘heartbeat’);

}

This will completely stop Heartbeat from working on your website and it will no longer add to the number of executions and the CPU time utilized for your account.

My aim is to create enriching content on topics related to SEO, web hosting and social media. The idea is to elevate the readers to new levels of usability, accessibility and understanding.

Trusted By Thousands of Clients & Big Businesses

We highly appreciate the kind and stellar feedback we receive from our customers. Delivering the best is our goal! MilesWeb is rated Excellent out of 5 based on reviews. Read more reviews.

Excellent
Based on reviews
2 hours ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
4 hours ago
Milesweb is superb Hosting pro...
Milesweb is superb Hosting provider ever, their Support team is amazing!!!...
Abhishek Singh
15 hours ago
Great support in great timing...
We need urgent assistance on changes in a primary domain on our client's Cpanel accounts and reached...
Riyaju Deen
21 hours ago
Best Website Hosting platform ...
I was new on MilesWeb. And needed help on multiple areas from setting up to getting started with cre...
Harshada
1 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
1 days ago
the team is very supportive th...
the team is very supportive though at times effort needs to be made to make understand the problem s...
Suree Sharma
1 days ago
I am using miles web for 3plus...
I am using miles web for 3plus years, very quick and perfect support by the team, they helped me man...
Sri Raghav
2 days ago
The service is good...
The service is good. They are answering with patience and doing the needful as soon as possible....
MR
2 days ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
3 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
4 days ago
positively helped me with find...
positively helped me with finding insecure content on my website causing SSL to not work properly on...
Thaviraj Junglee
4 days ago
Exceptional support, Truly Pra...
I had opted for the basic wordpress hosting plan as I intended to experiment with various plug-ins. ...
Aseem Chandna