Websites often tend to load slower than expected, leaving a bad taste on the user’s side. Optimizing WordPress admin-ajax.php might be the solution.
Most of the cases are caused by memory overload (internal error 500). But, there is another important variable called Admin-Ajax.PHP that we often forget.
As you have guessed, this article will present to you how to optimize WordPress admin-ajax.php to boost your site. This is a technical blog with pinpoint details. So, make sure to take your time and read along.
What is Admin-ajax.php?
Admin-Ajax.Php was first introduced in WordPress 2.1 as one of the core technology of WordPress. What it basically does is establishing a connection between the client and the server.
You will find this file inside the site’s /wp-admin directory. Once overloaded, the file is responsible for slow speed, error 502, or error 504.
Admin Ajax is responsible to establish a back & forth connection by pinging server requests very often. Sometimes, the number of requests ends up in a large number, resulting in a slow server speed.
That is why we need to optimize WordPress admin-ajax.php so that it does not slow the site down.
Learn more about WordPress
Diagnosis of Admin-Ajajx.PHP for slow server speed
There are several reasons behind a slow site speed due to admin-ajax.
- Corrupted plugin
- Corrupted theme
- High server requests due to
- WordPress core
- DDoS attack
The prime suspect in this case should be a corrupted plugin. A 3rd party plugin has to send continuous requests to the server to stay functional. So, the admin-ajax.php handles the server requests on behalf of the plugin. As a result, a bad plugin may trigger an unexpectedly high volume of server requests.
Again, the issue might be a cause of the theme you are using. Themes having unutilized admin-ajax may end up slowing the site down.
But in both of these cases, the site’s backend may not be involved.
Optimize WordPress admin-ajax.php
To solve issues regarding plugins and themes, you need to identify the corrupted ones through tests. Now, you can do one of the two things here:
- Use WebPage Test or GTmetrix
- Manually tweak the plugins
The faster way to optimize WordPress admin-ajax.php is to run site tests via trusted links.
A GTmetrix test run would show a good number of site stats. From there, you need to trace the function causing high server requests or delay through admin-ajax.
Usually, the waterflow curve shows a complete site loading response structure. From there, you can pinpoint the reason for the admin-ajax overload.
Sometimes, you may fail to properly identify the cause with site test results due to the massive amount of data. In that case, a slow approach is the best course of action to optimize WordPress admin-ajax.php.
For this, you need to deactivate all plugins within your website and see if the issue remains. If yes, then the theme is suspected to be the faulty one. If no, then try activating one plugin at a time a trace the corrupted one.
Admin-ajax.php issue due to site backend – Heartbeat API
Your website may be good in the frontend performance but still slow because of the backend problems. Let’s figure it out.
Heartbeat API was introduced with WordPress 3.6 version back in the old days. It usually sends frequent ajax requests for the site’s dynamic functionalities.
What it does is, it sends ajax requests every 15 seconds for initiating auto-saving, auto-refreshing commands. In one way, it ensures the proper saving of important data and increases user experience.
But the problem is, a website having multiple users at the development board will face a slow response from the server. Also, consumers will face frequent site misbehave regarding loading speed.
That’s why you need to optimize WordPress admin-ajax.php.
Optimize Heartbeat API – solve WordPress admin-ajax.php issue
To optimize the Heartbeat API, you need the help of a plugin called Heartbeat Control.
Go to Dashboard> Plugins> Add New> search for Heartbeat Control and install it.
Once installed, you will find it inside the Settings tab. Click on it and see the options on the display. You will find options to disable, enable, and modify the Heartbeat API.
If you are the sole user of the site’s dashboard, you may not need to change the settings. Again, disabling the Heartbeat API will result in a non-dynamic website.
So, to keep your site dynamic but reduce ajax overload, set the frequency from 15 to 300 from the menu. Doing so will change the request time from 15 seconds to 300 seconds and will reduce the server load a lot.
In case of low CPU configuration, we recommend you to disable Heartbeat API from Frontend and Dashboard. Of course, modifying the request time is also a good move.
Optimizing WordPress admin-ajax.php varies for every website. But, fixing it will definitely improve your site speed by a lot. So, if you are facing trouble with site speed, it’s best if you follow this article through and through.
This blog is brought to you by Element Pack, the market-leading Elementor page builder plugin.
Thanks for your time.