WordPress
admin-ajax.php High CPU: Read the Access Log, Then Tame Heartbeat
When your host says admin-ajax.php high CPU is slowing the account down, it's pointing at a doorway, not a culprit. admin-ajax.php is one file that dozens of WordPress features use to talk to the server: the Heartbeat in your dashboard, live search boxes, view counters, form plugins, and sometimes a bot that found it and won't stop knocking.
So the fix isn't "install a Heartbeat plugin and hope." It's two steps, in order: read the access log to see who's calling admin-ajax.php and from where, then slow down the WordPress Heartbeat or deal with the real caller. The log usually takes ten minutes to read and saves you from fixing the wrong thing.
If you'd rather hand over the log and get back a fix, send me the details through the speed questionnaire and I'll reply with a plan and a fixed quote within one business day.
What admin-ajax.php actually does
Every time a WordPress page needs to ask the server something without reloading, it can send a request to /wp-admin/admin-ajax.php. Each of those requests loads WordPress and its plugins in PHP, which is why lots of them add up to real CPU (processor) time.
The biggest regular caller is the Heartbeat API. WordPress describes it as a server polling API that ticks every 15 to 120 seconds and answers through an admin-ajax handler. The Heartbeat Control plugin page lists the typical defaults: every 15 seconds on post edit screens and every 60 seconds on the dashboard.
That sounds small. Now picture three staff members who each leave two editor tabs open all day. That's six tabs calling the server four times a minute, for eight hours, whether anyone is typing or not.
Step 1: Read the access log
The access log records every request the server receives, with the time, the visitor's IP address, the page they came from and their browser. It tells you who is knocking.
On cPanel, open Metrics > Raw Access. It lets you download a .gz file containing the access log for each domain. On Plesk, look under the domain's Logs. Most hosts use Apache's "combined" format, where the referring page and the browser name come after the status code and size, in quotes.
Unzip it and run these over SSH, or on your own computer with any Linux or Mac terminal:
# All four commands are read-only. They just count lines in the log file.
# 1. How many admin-ajax.php requests, per hour? Spikes show up here.
grep "admin-ajax.php" access.log | awk '{print substr($4, 2, 14)}' | uniq -c | tail -24
# 2. Which IP addresses send the most?
grep "admin-ajax.php" access.log | awk '{print $1}' | sort | uniq -c | sort -rn | head -10
# 3. Which pages trigger them? (the referer field)
grep "admin-ajax.php" access.log | awk -F'"' '{print $4}' | sort | uniq -c | sort -rn | head -10
# 4. Any GET requests show the action name right in the URL.
grep "admin-ajax.php?action=" access.log | grep -o "action=[^& ]*" | sort | uniq -c | sort -rn | head -10What the patterns mean
| What you see | What it usually means | What to do |
|---|---|---|
Referer is /wp-admin/post.php or the dashboard, a few IPs |
Heartbeat from open editor and admin tabs | Slow Heartbeat down (step 2) |
| Referer is your public pages, many different IPs | A plugin making front-end calls for every visitor | Find the plugin, replace or reconfigure it |
| One or two IPs, no referer, hundreds per hour | A bot or scraper hammering the file | Block it (step 3) |
| Your own office IP, all night | A tab left open on a work computer | Close it. Seriously, that's the fix |
When the log doesn't show the action
Most admin-ajax calls are POST requests, and their action name sits in the request body, which the access log doesn't record. To see it, add a tiny temporary logger as a must-use plugin (a file WordPress always loads, saved in wp-content/mu-plugins/):
<?php
// wp-content/mu-plugins/log-ajax-actions.php
// Writes each admin-ajax action name to the PHP error log. Delete it after a day.
// Could break: nothing, but the log grows fast on a busy site.
if ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_REQUEST['action'] ) ) {
error_log( 'admin-ajax action: ' . sanitize_key( $_REQUEST['action'] ) );
}After a few hours, count the lines. heartbeat at the top means step 2. A plugin's name at the top means you've found your culprit.
Step 2: Slow the WordPress Heartbeat (don't kill it)
It's tempting to switch Heartbeat off completely. I don't, because the editor relies on it for useful things, like warning you when a colleague has the same post open and telling you when your login session has expired. Slowing it down gets most of the CPU savings without losing those.
WordPress exposes a heartbeat_settings filter for exactly this. Here's the must-use plugin I typically start with:
<?php
// wp-content/mu-plugins/heartbeat-tune.php
// Asks Heartbeat to tick once a minute in wp-admin and removes it from public pages.
// Could break: a front-end plugin that needs Heartbeat (rare; live chat or
// front-end editing tools). Test those features after adding this.
add_filter( 'heartbeat_settings', function ( $settings ) {
$settings['interval'] = 60;
return $settings;
}, 99 );
add_action( 'wp_enqueue_scripts', function () {
wp_deregister_script( 'heartbeat' );
}, 100 );Why a snippet and not the plugin? The Heartbeat Control plugin works, but as of October 2026 its wordpress.org page shows it was last updated in 2023 and hasn't been tested with the latest three major WordPress releases. Ten lines of code you can read beat a plugin nobody is maintaining. Many caching plugins also include a Heartbeat setting, so check yours before adding anything new.
Step 3: Deal with the other callers
If the log pointed somewhere other than Heartbeat:
- A front-end plugin (view counters, "people are viewing this" popups, live search) is calling admin-ajax.php for every visitor. Page caching can't help, because these are POST requests. Turn the feature off, find a lighter plugin, or ask the developer whether it can use the REST API with caching.
- A bot is hitting the file directly. Block the IP at Cloudflare or your firewall if you have one. Otherwise, a small
.htaccessrule does it, using the Apache 2.4 authorization syntax:
# Blocks one abusive IP from the whole site. Put near the top of .htaccess.
# Could break: that IP's legitimate visitors, if it's a shared office or VPN address.
<RequireAll>
Require all granted
Require not ip 203.0.113.45
</RequireAll>Bots that hammer admin-ajax.php often hammer xmlrpc.php too. My guide on whether to disable xmlrpc.php covers that door.
Final Thoughts
admin-ajax.php high CPU is a question, and the access log answers it. Count the requests, look at who sends them and from which page, then fix the actual caller: slow Heartbeat in the dashboard, remove it from the front end, swap out a chatty plugin, or block a bot. If CPU stays high after all that, the site may simply have outgrown its plan, and memory limits are often the next wall. My post on the WordPress memory limit explains that ceiling.
admin-ajax.php high CPU FAQs
Why is admin-ajax.php using so much CPU?
Because every request to admin-ajax.php loads WordPress and its plugins in PHP, and something is sending lots of them. The usual sources are the Heartbeat API from open dashboard or editor tabs, a plugin making background calls for every visitor, or a bot hitting the file directly. Your access log shows which one by the referring page and IP address of each request.
Is it safe to disable the WordPress Heartbeat?
Disabling it on public pages is usually safe, since few sites need it there. Disabling it in wp-admin is riskier, because the editor uses it for post locking (warning you when someone else is editing the same post) and login session checks. Slowing it to once every 60 seconds in the admin is the safer middle ground and still cuts the request count sharply.
How do I find which plugin is calling admin-ajax.php?
Start with the access log and look at the referer field to see which pages trigger the calls. For the action name, which is usually hidden in POST requests, add a small temporary must-use plugin that logs the action parameter to the PHP error log. After a few hours, the most frequent action name usually matches a plugin's prefix, which tells you who's responsible.
Does caching help with admin-ajax.php load?
Not directly. Page caching stores finished pages, but admin-ajax.php requests are mostly POST requests that page caches skip by design. Caching still helps overall server load, which leaves more room for the requests that do reach PHP. To cut admin-ajax.php load itself, you need to reduce how often it's called: slower Heartbeat, fewer chatty plugins, and blocked bots.
Next step
If you'd like someone to read the logs and fix the cause, CPU spikes are a regular part of my WordPress speed work. For ongoing monitoring so it doesn't creep back, there's also my monthly WordPress upkeep plan. Tell me about your site in the speed questionnaire and I'll take a look.
Want a second pair of eyes on your site?
Tell me what's going on in the site speed optimization questionnaire. I reply with a plan and a fixed quote within one business day.