How To Reduce Admin-Ajax Server Load In WordPress

A lot of things happen in a few seconds that may slow down the website, learn how to reduce WordPress admin-ajax server load to speed it up.

Updated on August 5, 2022
How To Reduce Admin-Ajax Server Load In WordPress

To increase better user experience, we always end up increasing site speed. Clicking a website link seems like a simple thing. But have you ever thought, how many requests are instantly pinged within a few seconds after a single click? Many things happen within these few seconds that may slow down the website Admin-Ajax it’s the one explained here. In today’s article, you’ll learn how to reduce admin-ajax server load in WordPress.

Although, there are various things behind the slow loading of the site. If checking on site speed test tools, sometimes it shows a warning in the admin Ajax.php file. That means the Admin Ajax.php file is also one of the reasons behind the site’s slow loading.

Admin-ajax.php is part of the WordPress AJAX API. It does handle requests from both the backend and front end as well. Ajax allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes.

In WordPress 3.6, WordPress introduced Heartbeat API. The API stimulates a bidirectional connection between the browser and the server. In addition, it was used for autosave, post locking, and log-in expiration warning while a user is writing or editing.

How To Reduce Admin-Ajax Server Load?

Heartbeat API triggers events on receiving data/response while creating requests for communication with the server. This generally causes a significant load on the server and thus slows down the website.

Due to this Heartbeat API, Admin-ajax.php generates requests after every 15 seconds. The request can be any communication with the server. And thus, by sending too many requests, the server takes a long time to display your content or load the website.

Speed up WordPress Admin Dashboard

How To Reduce Admin-Ajax Server Load In WordPress - Speed
How To Reduce Admin-Ajax Server Load In WordPress – Speed

So, the best solution to speed up the backend site is disabling the Heartbeat API. Instead, install the Heartbeat control plugin. The heartbeat control plugin allows you to manage the WordPress heartbeat API frequency easily. Through this plugin, the heartbeat API can be disabled entirely. So a great method to reduce admin-ajax server load in WordPress

Note: If you use any caching plugin, disable the object cache before moving forward. It will drastically speed up the WordPress dashboard.

To Install the Heartbeat Control plugin to To Reduce Admin-Ajax Server Load In WordPress

To Install Heartbeat Control WordPress plugin
How To Install Heartbeat Control WordPress Plugin
  1. Login to your WordPress Admin Dashboard.
  2. Go to Plugins>> Add new and search for Heartbeat Control.
  3. Now, Install and Activate it.

The configuration of the Heartbeat Control Plugin:

The configuration of the HeartBeat Control Plugin:
How to Limit Heartbeat API in WordPress
  1. Go to settings and then Control HeartBeat (Settings>> Control Heartbeat) to reduce admin-ajax server load in WordPress.
  2. Now, select locations. The locations have three options to choose.
    • Disable Everywhere
    • Disable on Dashboard Page
    • Allow Only on Post Edit Page
  3. If I guess, your site regularly contributes to more than 1 user. So, I suggest selecting Allow Only on the Post Edit Page location to disable the plugin.
  4. You must select the time interval for executing admin-ajax requests by going through the Override Heartbeat Frequency menu.
  5. Set the time interval to 60 seconds. By doing this, the requests will generate after every 60 seconds. This drastically reduces the load on the server.
  6. Now, search for the plugin that uses Heartbeat API.
    • To do so, Go to the GTMetrix site and analyze your website. Now, go to the Waterfall tab and examine which file takes a long time to connect and respond.
    • Now, scroll down and see if there is an entry for POST-admin-ajax.php.
    • If yes, expand it and navigate to the Post tab to find the plugin.
  7. Now you are all set.