Skip to content
FunnelGuard

Fix guide by FunnelsGuard

admin-ajax.php slow on every WordPress page: how to fix it

PRF-066Medium impactCould addBy FunnelGuardPublished Updated
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.

How one slow AJAX call hurts a cached page
  1. Visitor opens pageCached HTML is served quickly
  2. Plugin script runsCalls admin-ajax.php on load
  3. admin-ajax.php respondsFull WordPress boot, slow query, 2+ s
  4. Page content or widget appearsCart count, popup or form waits
  5. 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

Server response time as admin-ajax calls per page riseExample numbers
Server response time as admin-ajax calls per page rise (example)0 calls: 300 ms; 2 calls: 700 ms; 5 calls: 1,500 ms; 8 calls: 2,600 ms09971,9933007001,5002,6000 calls2 calls5 calls8 callsms

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

Find admin-ajax.php calls on a public page
  1. Open DevTools

    In Chrome, open your page in a private window (logged out), press F12 and go to the Network tab.

  2. Filter and reload

    Type admin-ajax in the filter box, tick Disable cache and reload the page.

  3. 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.

  4. 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.

  5. Check how many fire

    Count calls on load and after a few seconds. Repeating calls (polling) are the most costly.

How to fix it

Fix order
  1. 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.

  2. 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.

  3. Replace the plugin if it cannot be tuned

    Pick a lighter alternative that renders from cached HTML or uses the REST API with caching.

  4. Limit Heartbeat

    Slow or disable Heartbeat on pages where it is not needed, using a plugin that offers this setting or the code below.

  5. 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.

Fix by platform
  1. Find the caller

    Install Query Monitor, load the page and open its AJAX or HTTP requests panel to see which plugin handles the action.

  2. 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.

  3. 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.

Disable Heartbeat outside the post editorphp
add_action( 'init', function () {
    global $pagenow;
    if ( $pagenow !== 'post.php' && $pagenow !== 'post-new.php' ) {
        wp_deregister_script( 'heartbeat' );
    }
}, 1 );
Before and after

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

Confirmation checks
  • 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

Habits that keep it away
  • 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.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.