On this page
What this issue is
/wp-admin/admin-ajax.php is a single file that handles AJAX requests. AJAX means the page asks the server for data in the background without reloading. Many plugins use it: live search, cart counters, view counters, popups, form pre-fill, related posts and the admin Heartbeat.
- Visitor opens pageCached HTML is served quickly
- Plugin script runsCalls admin-ajax.php on load
- admin-ajax.php respondsFull WordPress boot, slow query, 2+ s
- Page content or widget appearsCart count, popup or form waits
- Visitor actsLeaves or hesitates
The cached HTML is fast, but a background call to admin-ajax.php goes to PHP and the database.
Why it costs you leads or sales
Example: illustrative numbers showing how response time can grow when more uncached AJAX calls hit a busy server.
How to check if your site has it
Open DevTools
In Chrome, open your page in a private window (logged out), press F12 and go to the Network tab.
Filter and reload
Type admin-ajax in the filter box, tick Disable cache and reload the page.
Read the timing
Click each request. Check the Time column and the Waiting (TTFB) value in the Timing tab. Over 500 ms is worth fixing.
Identify the action
In the Payload tab, find the
action=value. Its name usually points to the plugin, such as a cart fragment, search or popup action.Check how many fire
Count calls on load and after a few seconds. Repeating calls (polling) are the most costly.
How to fix it
Identify the plugin by action name
Search your plugins folder for the action string:
grep -r "wp_ajax_nopriv_youraction" wp-content/plugins. Or disable plugins one at a time on a staging copy and repeat the Network test.Turn off the feature if you do not need it
Many plugins have settings for live view counts, cart fragments, popups or stats. Switching them off removes the call.
Replace the plugin if it cannot be tuned
Pick a lighter alternative that renders from cached HTML or uses the REST API with caching.
Limit Heartbeat
Slow or disable Heartbeat on pages where it is not needed, using a plugin that offers this setting or the code below.
Add object caching and enough PHP workers
Ask your host for Redis or Memcached object caching and check PHP worker limits. This makes the remaining calls cheaper.
Find the caller
Install Query Monitor, load the page and open its AJAX or HTTP requests panel to see which plugin handles the action.
Adjust plugin settings
Open the plugin's settings and disable live counters, polling or cart fragments you do not need. In WooCommerce, check that cart fragments are only loaded where a mini cart is shown.
Control Heartbeat
Use a performance plugin's Heartbeat setting, or add the snippet below to a small custom plugin or your child theme's functions.php.
Replace polling with cached endpoints
Serve public data from a cached REST route or static JSON file instead of calling admin-ajax.php on every view.
Load scripts only where needed
Use
wp_enqueue_scriptconditionally, for example only on pages that contain the widget, so other pages never make the call.Debounce and delay
Fire the call after user interaction or after the page is idle, not on load.
Check for tags that call AJAX
If a custom HTML tag posts to admin-ajax.php on All Pages, restrict its trigger to the pages that need it.
add_action( 'init', function () {
global $pagenow;
if ( $pagenow !== 'post.php' && $pagenow !== 'post-new.php' ) {
wp_deregister_script( 'heartbeat' );
}
}, 1 );Before
- Several admin-ajax.php calls on every page load
- Each call takes over 1 s on a busy server
- PHP workers stay busy, new visitors queue
After
- Unneeded calls removed or limited to the pages that use them
- Remaining calls cached or fast
- Workers free for real page requests
How to confirm it's fixed
- Logged-out page load shows no unneeded admin-ajax.php requests in the Network tab
- Remaining calls respond in well under 500 ms
- No call repeats on a timer
- Cart, search, popups and forms still work
- Page speed test shows a lower server response time
- Server CPU and PHP worker use are lower during a traffic burst
How to prevent it happening again
- Test new plugins on staging and check the Network tab before going live
- Re-check after plugin and theme updates, which can add new calls
- Load widget scripts only on pages that use them
- Keep object caching enabled and review PHP worker limits with your host
- Review slow requests monthly in Query Monitor or your host's logs
How FunnelGuard handles this
Questions people ask
Why is admin-ajax.php so slow on my WordPress site?
Each request loads WordPress and every active plugin, and many plugins run database queries inside it. POST requests are also not cached, so a slow action is slow every time. Find the action name in the Network tab to see which plugin is responsible.
How do I find which plugin is calling admin-ajax.php?
Open DevTools, go to the Network tab, filter by admin-ajax and read the action value in the Payload tab. Search your plugins folder for that string, or use Query Monitor to see the handler. Disabling plugins one at a time on staging also works.
Is it safe to disable admin-ajax.php?
No. WordPress core, themes and many plugins use it for forms, carts and logins, so blocking it can break lead capture. Instead, remove or tune the specific slow action.
Does the WordPress Heartbeat API slow my site down?
It can. Heartbeat sends regular admin-ajax.php requests from the dashboard and editor, which uses server resources on busy or shared hosting. Limiting its frequency or disabling it outside the editor reduces the load.
Why does admin-ajax.php run on every page of my site?
A plugin or theme script is enqueued site-wide and calls the endpoint on load. Common sources are cart fragments, view counters, popups and live search. Load those scripts only on the pages that need them.
Can a page cache fix slow admin-ajax.php requests?
Not usually. Page caches store full HTML pages, while admin-ajax.php calls are typically POST requests that bypass the cache. Object caching helps make them cheaper, but removing unneeded calls helps most.
Does FunnelGuard detect slow admin-ajax.php calls?
No, this is not a check FunnelGuard offers yet. It does monitor your funnel journeys and would show a step failing if a slow server broke it, but you need DevTools, Query Monitor or server logs to trace admin-ajax.php itself.
Related issues
- PRF-050TTFB over 800 msFix guide
- PRF-051TTFB spikes at certain times (cron, backups, traffic peaks)Fix guide
- PRF-053Full-page cache disabled or bypassed (WordPress cache plugin off)Fix guide
- PRF-061Origin server returns 5xx intermittentlyFix guide
- PRF-063Slow form submit response (over 5 s)Fix guide
- PRF-065Database-heavy pages slow under load (WooCommerce cart fragments)Fix guide