How to stop admin-ajax from overloading your WordPress site

The WordPress Heartbeat API is used to have WordPress to connect between your web browser and the Wordpress script or server. It is also used for session management, revision tracking, and auto saving. The WordPress Heartbeat API uses the file  /wp-admin/admin-ajax.php. The issue is this file can also cause excessive requests to admin-ajax.php, leading to high load and CPU usage. If a web browser is left open on a page using the Heartbeat API, this could potentially be a major issue. The best solution is to remove it, or as a alternative you can change it only run every 60 seconds.

How to remove admin-ajax.php from Wordpress

1. To remove the Heartbeat API, locate your WordPress theme's functions.php file. If you are using the default Twenty Fifteentheme, the path would look like:


Make a copy of the file, something like functions.php-bk just to be safe. 2. Now disable WordPress Heartbeat everywhere. Towards the top of the functions.php file, add the highlighted codeto disable the Heartbeat everywhere:

 * @since Twenty Fifteen

add_action( 'init', 'stop_heartbeat', 1 );

function stop_heartbeat() {

 * Set up the content width value based on the theme's design.

Once it's added save the file and make sure everything still works. This should take care of it and allow Wordpress to work faster without the admin-ajax code.

Change the frequency of the default Heartbeat requests

1. Make a backup copy of this file:


2. Find the 3 separate instances for request activity, 15 seconds, 30 seconds, and 60 seconds, and change the time intervals to:

B.mainInterval<15? 15: change to B.mainInterval<120? 120:

case 30:...30,b=1>b||b>30?30: change to case 300:...300,b=1>b||b>300?300:

B.mainInterval>60&&(B.mainInterval=60)) 60:...mainInterval:60 change to B.mainInterval>600&&(B.mainInterval=600)) 600:...mainInterval:600

We suggest double checking the code so only the numbers change, at this time the code is exact but Wordpress is known to change their code time to time.

This will slow down the requests and keep any load issues at bay.

  • wordpress, wordpress ajax, wordpress load, wordpress cpu, overload
  • 10 Users Found This Useful
Was this answer helpful?

Related Articles

How many WordPress websites can I have on one plan?

The Easy plan can handle one WordPress pretty well but most Wordpress sites will need the Pro...

What is the maximum file upload size for WordPress?

The default file upload size is 200 megabytes for all shared and reseller web hosting servers. In...

How to stop wp-cron.php from overloading your WordPress site

The file wp-cron.php in WordPress is used to process pending posts and check for updates. The...

How to remove and add a widget in Wordpress

Here is a fast tutorial on adding and removing widgets in Wordpress.

Do I need a live registered domain to use WordPress and the Easy Site Builder?

Just a friendly reminder that WordPress and the Easy Site Builder are web based website building...