How to find which plugin calls admin-ajax.php

Some plugins use AJAX requests to launch a custom wp_query in order to show it in the page without a complete reloading, which is a good method for displaying dynamic content on a cached page. 

This AJAX request is sent to a dedicated WordPress AJAX file: 

https://example.com/wp-admin/admin-ajax.php

But sometimes these queries significantly increase your load time , especially when there are several:

Note: When admin-ajax.php calls are initiated from within JavaScript, you may be able to reduce the performance impact by using the Delay JavaScript Execution feature

Find plugin(s) generating AJAX requests

A

 You have a few plugins

If you only use a few plugins then you can do the following:

  1. Deactivate the first plugin.
  2. Clear WP Rocket's cache.
  3. Test your website here: https://tools.pingdom.com/
  4. Check if the admin-ajax.php query is still there.
  5. If it is still there, re-activate your plugin and repeat step 1 with the next plugin.
B

 You have a lot of plugins

If you have a lot of plugins - or you do not want to disable your plugins - you will have to go through the Chrome console.

  1. Open Developer Tools. You do that either by right-clicking and choosing Inspect Element, or at the top of the window go to: View→Developer→Developer Tools.
  2. Click on Network tab and reload your page. You should see scrolling loading your resources like this: 
  3. Go to the top left of the console in the Filter search box (just below the red dot) and enter admin-ajax, the list of culprits should be displayed
  4. Then select the one you want and check its information like this:
  5. When you view the Form Data and Preview, you will find some clues as to which plugin is generating this request. The action or result often includes the initials or a reference to the related plugin. In this example, we found "update_views_ajax" action and "WPP" which indicate an AJAX query of WP Popular Posts plugin.
  6. Test if it is actually this plugin using Method A if you wish.

Found those plugin(s), what now?

Sometimes the solution is to activate a plugin option avoiding this query, if not, you can contact the plugin developer to find a fix to reduce the loading time of this query.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.