{"id":15351,"date":"2019-02-15T14:37:15","date_gmt":"2019-02-15T14:37:15","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=15351"},"modified":"2026-03-09T19:19:47","modified_gmt":"2026-03-09T19:19:47","slug":"how-to-fix-admin-ajax-file-in-wordpress","status":"publish","type":"post","link":"\/ng\/tutorials\/how-to-fix-admin-ajax-file-in-wordpress","title":{"rendered":"How to resolve high usage of admin-ajax.php in WordPress"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>Asynchronous JavaScript and XML (AJAX) is a set of web development techniques that enhances a website&rsquo;s user experience and interactivity. <\/p><p>WordPress theme and plugin developers commonly implement AJAX to create dynamic and interactive features. Moreover, AJAX allows site visitors to submit a newsletter form or comment on a blog post without reloading the web page. <\/p><p>WordPress is a content management system (CMS) that utilizes the <strong>admin-ajax.php<\/strong> file to manage AJAX requests. <\/p><p>The <strong>admin-ajax.php<\/strong> file enhances the website user experience. However, too many requests can impact performance. In this article, we will share troubleshooting methods to reduce your site&rsquo;s <strong>admin-ajax.php<\/strong> file usage.<\/p><p>\n\n\n<div class=\"protip\">\n                    <h2 class=\"featured-snippet title\">What Is the admin-ajax.php File in WordPress?<\/h2>\n                    <p><br>\nThe <strong>admin-ajax.php file<\/strong> is a WordPress core file. It serves as an endpoint for handling AJAX calls or requests, such as loading comments and processing form submissions. This PHP script processes web server data and returns relevant information to users&rsquo; web browsers. By default, the <strong>admin-ajax.php<\/strong> file is located in the <strong>wp-admin<\/strong> folder.<\/p>\n                <\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-how-can-admin-ajax-php-slow-down-your-wordpress-site\">How Can admin-ajax.php Slow Down Your WordPress Site?<\/h2><p>The following are several factors that may cause an overload in WordPress AJAX requests:<\/p><h3 class=\"wp-block-heading\" id=\"h-excessive-plugin-usage\">Excessive Plugin Usage<\/h3><p>Plugins often require additional resources and code to fully operate. Using too many plugins that rely on AJAX requests can lead to excessive usage of the <strong>admin-ajax.php<\/strong> file, resulting in a <a href=\"\/ng\/tutorials\/why-is-my-wordpress-site-so-slow\">slower page load time<\/a>.<\/p><h3 class=\"wp-block-heading\" id=\"h-high-traffic-volume\">High Traffic Volume<\/h3><p>A website with heavy traffic can eventually cause the <strong>admin-ajax.php<\/strong> file to overload. This is because WordPress uses the PHP file to establish a connection between your website&rsquo;s front and back end.<\/p><h3 class=\"wp-block-heading\" id=\"h-inefficient-database-queries\">Inefficient Database Queries<\/h3><p>Database queries retrieve and update WordPress site information from the back end. However, these queries can lead to high usage of the <strong>admin-ajax.php<\/strong> file if not optimized.<\/p><h2 class=\"wp-block-heading\" id=\"h-why-is-it-important-to-reduce-wordpress-admin-ajax-requests\">Why Is It Important to Reduce WordPress Admin AJAX Requests?<\/h2><p>Reducing the high load of <strong>admin-ajax.php<\/strong> in WordPress can bring benefits to your site, such as:<\/p><h3 class=\"wp-block-heading\" id=\"h-improved-performance\">Improved Performance<\/h3><p>Minimize AJAX requests to reduce server response time. This results in faster page load times and a smoother browsing experience for your WordPress website visitors.<\/p><h3 class=\"wp-block-heading\" id=\"h-enhanced-user-experience\">Enhanced User Experience<\/h3><p>An optimized Admin AJAX file lets your website respond quickly to user interactions. Therefore, visitors can seamlessly navigate through your web pages, interact with buttons and forms, and access content. A positive user experience boosts engagement, returning visitors, and conversion rates.<\/p><h3 class=\"wp-block-heading\" id=\"h-reduced-server-load\">Reduced Server Load<\/h3><p>Reducing the number of <strong>admin-ajax.php<\/strong> requests can boost the server load, making your website accessible and responsive during high-traffic times.<\/p><p>You can also minimize server resources, such as processing power, memory, and storage space, so the website can handle traffic more effectively. This is especially helpful when running sites on a shared hosting plan.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-troubleshoot-the-admin-ajax-php-issue\">How to Troubleshoot the admin-ajax.php Issue<\/h2><p>In the following sections, we will use <strong>GTmetrix<\/strong> and <strong>Chrome Developer Console<\/strong> to identify if the <strong>admin-ajax.php<\/strong> file slows down your website.<\/p><h3 class=\"wp-block-heading\" id=\"h-gtmetrix\">GTmetrix<\/h3><p><a href=\"\/ng\/tutorials\/gtmetrix-for-testing-websites-speed\">GTmetrix<\/a> is a web-based tool used to monitor and analyze <a href=\"\/ng\/tutorials\/website-performance\">site performance<\/a>. It measures various performance metrics and provides insights to fix or improve them.<\/p><p>The following are the steps to identify issues related to the <strong>admin-ajax.php<\/strong> file:<\/p><ol class=\"wp-block-list\">\n<li>Go to the <a href=\"https:\/\/gtmetrix.com\/\">GTmetrix homepage<\/a> and type your website URL in the required field.<\/li>\n\n\n\n<li>Click the <strong>Test your site<\/strong> button to run the performance check. Note that the process varies depending on the size of your website.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/gtmetrix-homepage-test-your-site-button.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"566\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/gtmetrix-homepage-test-your-site-button.png\/public\" alt=\"The GTmetrix homepage with the Test your site button highlighted\" class=\"wp-image-91342\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/gtmetrix-homepage-test-your-site-button.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/gtmetrix-homepage-test-your-site-button.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/gtmetrix-homepage-test-your-site-button.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/gtmetrix-homepage-test-your-site-button.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>Once finished, navigate to the <strong>Waterfall<\/strong> tab on the Latest Performance Report page.<\/li>\n\n\n\n<li>Search for <strong>admin-ajax.php<\/strong> using the search bar. For instance, the following performance report shows that the <strong>POST admin-ajax<\/strong> request takes longer than other requests.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/gtmetrix-waterfall-tab-post-admin-ajax.png\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"525\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/gtmetrix-waterfall-tab-post-admin-ajax.png\/public\" alt=\"The GTmetrix Waterfall tab, showing the POST admin-ajax.php request\" class=\"wp-image-91344\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/gtmetrix-waterfall-tab-post-admin-ajax.png\/w=900,fit=scale-down 900w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/gtmetrix-waterfall-tab-post-admin-ajax.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/gtmetrix-waterfall-tab-post-admin-ajax.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/gtmetrix-waterfall-tab-post-admin-ajax.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/a><\/figure><\/div><ol start=\"5\" class=\"wp-block-list\">\n<li>Click <strong>POST admin-ajax.php<\/strong> and navigate to the <strong>Post<\/strong> tab. The example below shows that the <strong>count_hit<\/strong> script causes the performance issue.<\/li>\n<\/ol><figure class=\"wp-block-image aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/post-admin-ajax-post-tab.png\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"79\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/post-admin-ajax-post-tab.png\/public\" alt=\"POST admin-ajax.php showing the Post tab\n\" class=\"wp-image-91345\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/post-admin-ajax-post-tab.png\/w=900,fit=scale-down 900w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/post-admin-ajax-post-tab.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/post-admin-ajax-post-tab.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/post-admin-ajax-post-tab.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/a><\/figure><h3 class=\"wp-block-heading\" id=\"h-chrome-developer-console\">Chrome Developer Console<\/h3><p>Another method to diagnose your site&rsquo;s Admin AJAX usage is by using Chrome Developer Console. Follow the steps below:<\/p><ol class=\"wp-block-list\">\n<li>Visit your website via Google Chrome.<\/li>\n\n\n\n<li>Right-click on the page, such as your homepage, and click <strong>Inspect<\/strong>. Alternatively, click the <strong>three dots icon<\/strong> on the top-right corner of the screen, and go to <strong>More tools<\/strong> &rarr; <strong>Developer tools<\/strong>.<\/li>\n\n\n\n<li>Click on the <strong>Network<\/strong> tab and reload your website.<\/li>\n\n\n\n<li>In the filter box, type <strong>admin ajax<\/strong> to see if any process uses a WordPress AJAX call.<\/li>\n<\/ol><h2 class=\"wp-block-heading\" id=\"h-how-to-reduce-high-usage-of-admin-ajax-in-wordpress\">How to Reduce High Usage of Admin AJAX in WordPress<\/h2><p>After identifying the <strong>admin-ajax.php<\/strong> file usage issue using GTmetrix or Google Chrome Console, implement the following methods to minimize the PHP file usage:<\/p><h3 class=\"wp-block-heading\" id=\"h-disable-wordpress-plugins\">Disable WordPress Plugins<\/h3><p>Since WordPress plugins frequently use AJAX calls, disabling them is the easiest way to solve the issue. Especially if you have identified that a particular WordPress plugin sends unnecessary AJAX requests. The following are the steps to deactivate it:<\/p><ol class=\"wp-block-list\">\n<li>Log in to your WordPress dashboard.<\/li>\n\n\n\n<li>Go to <strong>Plugins<\/strong> &rarr; <strong>Installed Plugins<\/strong>.<\/li>\n\n\n\n<li>Locate the plugin you want to disable and click the <strong>Deactivate<\/strong> button.<\/li>\n\n\n\n<li>Run a performance check using GTmetrix to see if the issue is solved.<\/li>\n<\/ol><p>If you cannot find which plugin is overloading the <strong>admin-ajax.php<\/strong> file, consider deactivating all plugins and running performance testing. Then, re-activate the plugins one by one if it doesn&rsquo;t cause any problems. We highly recommend backing up your WordPress website first to avoid unexpected errors.<\/p><h3 class=\"wp-block-heading\" id=\"h-enable-website-caching\">Enable Website Caching<\/h3><p>Caching is crucial as it helps <a href=\"\/ng\/tutorials\/speed-up-wordpress\">speed up your WordPress site<\/a>. It involves creating a static version of your web pages and storing them in the visitors&rsquo; browsers or servers. The cached web pages are used when returning visitors access your website, making the page load faster.<\/p><p>WordPress has several caching plugins to help mitigate the impact of <strong>admin-ajax.php<\/strong> requests and optimize website performance:<\/p><ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/wordpress.org\/plugins\/w3-total-cache\/\">W3 Total Cache<\/a> &ndash; reduces load and server response times by integrating advanced techniques, such as browser caching, CDNs, and CSS and JavaScript file minification.<\/li>\n\n\n\n<li><a href=\"https:\/\/wordpress.org\/plugins\/wp-super-cache\/\">WP Super Cache<\/a> &ndash; generates static HTML files from dynamic web pages and accelerates page load times using various caching options, such as Apache mod_rewrite, PHP, and legacy caching.<\/li>\n\n\n\n<li><a href=\"https:\/\/wp-rocket.me\/\" target=\"_blank\" rel=\"noreferrer noopener\">WP Rocket<\/a> &ndash; improves site performance by incorporating various caching mechanisms, like lazy loading, object caching, and GZIP compression.<\/li>\n\n\n\n<li><a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/\">LiteSpeed Cache<\/a> &ndash; Designed for WordPress websites running on LiteSpeed web servers. It includes features such as <a href=\"https:\/\/docs.litespeedtech.com\/products\/lscdn\">QUIC.cloud CDN<\/a> cache, Heartbeat control, and image optimization.<\/li>\n<\/ul><p><div class=\"protip\">\n                    <h4 class=\"title\">Suggested reading<\/h4>\n                    <p><a href=\"\/ng\/tutorials\/wp-super-cache-vs-w3-total-cache\">WP Super Cache vs W3 Total Cache<\/a><br>\n<a href=\"\/ng\/tutorials\/litespeed-website-optimization-tool\/\">How to Optimize Your Site to 100% with LiteSpeed Cache<\/a><\/p>\n                <\/div>\n\n\n\n<\/p><p>To demonstrate, we will share the steps to configure and use a caching plugin. We will use W3 Total Cache as the example:<\/p><ol class=\"wp-block-list\">\n<li>From the WordPress dashboard, install and activate the <strong>W3 Total Cache<\/strong> plugin.<\/li>\n\n\n\n<li>Once activated, navigate to <strong>Performance<\/strong> &rarr; <strong>Dashboard<\/strong>. Follow the W3 Total Cache setup guide.<\/li>\n\n\n\n<li>Click the <strong>Test Page Cache<\/strong> button on the Page Cache screen. Wait until the process is complete.<\/li>\n\n\n\n<li>Choose the best page caching option. We recommend choosing the one with the <strong>Recommend<\/strong> label. In this case, let&rsquo;s select <strong>Disk: Enhanced<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-disk-enhanced-option.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"583\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-disk-enhanced-option.png\/public\" alt=\"The W3 Total Cache plugin with the Disk: Enhanced option highlighted\" class=\"wp-image-91346\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-disk-enhanced-option.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-disk-enhanced-option.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-disk-enhanced-option.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-disk-enhanced-option.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"5\" class=\"wp-block-list\">\n<li>Run the database cache check by clicking the <strong>Test Database Cache<\/strong> button. By default, this feature is disabled. You can also choose a database caching option from the list. The plugin recommends <strong>Redis<\/strong> or <strong>Memcached<\/strong>.<\/li>\n<\/ol><figure class=\"wp-block-image aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-database-cache-page.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"582\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-database-cache-page.png\/public\" alt=\"W3 Total Cache showing the Database Cache page\n\" class=\"wp-image-91347\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-database-cache-page.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-database-cache-page.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-database-cache-page.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-database-cache-page.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><ol start=\"6\" class=\"wp-block-list\">\n<li>On the Object Cache page, click the <strong>Test Object Cache<\/strong> button. Wait until the process is finished.<\/li>\n\n\n\n<li>Choose the best object cache result. For instance, we will select the <strong>Disk<\/strong> option since it receives the fastest response time.<\/li>\n<\/ol><figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-browser-cache-screen-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"582\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-browser-cache-screen-1.png\/public\" alt=\"W3 Total Cache showing the Browser Cache screen with the Enabled setting highlighted\n\" class=\"wp-image-91377\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-browser-cache-screen-1.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-browser-cache-screen-1.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-browser-cache-screen-1.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-browser-cache-screen-1.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><ol start=\"8\" class=\"wp-block-list\">\n<li>On the next screen, click the <strong>Test Browser Cache<\/strong> button to perform the browser cache check. By default, the setting is set to the <strong>Enabled<\/strong> option.<\/li>\n<\/ol><figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-object-cache-page-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"583\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-object-cache-page-2.png\/public\" alt=\"The W3 Total Cache plugin showing the Object Cache page with the Disk option highlighted\n\" class=\"wp-image-91378\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-object-cache-page-2.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-object-cache-page-2.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-object-cache-page-2.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/w3-total-cache-object-cache-page-2.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><ol start=\"9\" class=\"wp-block-list\">\n<li>Enable the image optimization feature on the Lazy Load page by ticking the <strong>Lazy Load Images<\/strong> radio button.<\/li>\n\n\n\n<li>Review your W3 Total Cache settings and click the <strong>Dashboard<\/strong> button to complete the setup.<\/li>\n<\/ol><p>Hostinger hosting plans, including <a href=\"\/ng\/web-hosting\">Business Web Hosting<\/a> and <a href=\"\/ng\/cloud-hosting\">Cloud Startup<\/a>, have <strong>Object Cache <\/strong>and <strong>Cache Manager<\/strong> features. These built-in features automatically enable caching on your site, resulting in faster page load speed.<\/p><p>However, you must manually turn on Cache Manager using hPanel. Here are the steps:<\/p><ol class=\"wp-block-list\">\n<li>Log in to your Hostinger account and go to the <strong>Websites<\/strong> page.<\/li>\n\n\n\n<li>Select your website and click <strong>Manage<\/strong>.<\/li>\n\n\n\n<li>On the hPanel dashboard, navigate to <strong>Advanced<\/strong> &rarr; <strong>Cache Manager<\/strong>. Alternatively, use the search bar and type <strong>cache manager<\/strong>.<\/li>\n\n\n\n<li>Activate the feature by toggling on the <strong>Automatic cache<\/strong> option.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/hpanel-advanced-cachemanager.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1011\" height=\"301\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/hpanel-advanced-cachemanager.png\/public\" alt=\"The Cache Manager page on hPanel\" class=\"wp-image-91519\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/hpanel-advanced-cachemanager.png\/w=1011,fit=scale-down 1011w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/hpanel-advanced-cachemanager.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/hpanel-advanced-cachemanager.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/hpanel-advanced-cachemanager.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1011px) 100vw, 1011px\" \/><\/a><\/figure><\/div><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-wordpress-hosting\" href=\"\/ng\/wordpress-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"600\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/public\" alt=\"\" class=\"wp-image-111781\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=1536,fit=scale-down 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure><h3 class=\"wp-block-heading\" id=\"h-control-wordpress-heartbeat-api\">Control WordPress Heartbeat API<\/h3><p><a href=\"\/ng\/tutorials\/wordpress-heartbeat\">WordPress Heartbeat<\/a> API is a feature that allows real-time communication between a web browser and the server using AJAX requests.<\/p><p>However, its frequent requests can sometimes lead to high resource usage, increased server load, and heightened use of the <strong>admin-ajax.php<\/strong> file.<\/p><p>You can control WordPress Heartbeat API using two methods:<\/p><p><strong>Using the LiteSpeed Cache Plugin<\/strong><\/p><p>LiteSpeed Cache is a powerful plugin with various features, including Heartbeat Control. The following are the steps to configure this plugin to limit Heartbeat API usage:<\/p><ol class=\"wp-block-list\">\n<li>Log in to your WordPress dashboard.<\/li>\n\n\n\n<li>Install and activate the LiteSpeed plugin.<\/li>\n\n\n\n<li>From the sidebar menu, navigate to <strong>LiteSpeed Cache<\/strong> &rarr; <strong>Toolbox<\/strong> &rarr; <strong>Heartbeat<\/strong>. By default, the <strong>Heartbeat Control<\/strong> feature settings are disabled.<\/li>\n\n\n\n<li>Turn on an option and modify the <strong>Backend Heartbeat TTL<\/strong> value to your preference. For instance, enable the <strong>Backend Heartbeat Control<\/strong> and set the Backend Heartbeat TTL value to <strong>15<\/strong>.<\/li>\n\n\n\n<li>Save the changes.<\/li>\n<\/ol><p><strong>Modifying the function.php File<\/strong><\/p><p>Another way to limit or disable Heartbeat API is by adding custom PHP code into the <strong>function.php<\/strong> file. Follow the steps below:<\/p><ol class=\"wp-block-list\">\n<li>From the WordPress dashboard, navigate to <strong>Tools<\/strong> &rarr; <strong>Theme File Editor<\/strong>.<\/li>\n\n\n\n<li>Go to the <strong>Theme Files<\/strong> section and select <strong>Theme Functions<\/strong>, which contains the <strong>function.php<\/strong> file.<\/li>\n\n\n\n<li>Copy and paste the following code snippet to the text editor:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">add_action( 'init', 'disable_heartbeat', 1 );\n\nfunction disable_heartbeat() {\n\nwp_deregister_script('heartbeat');\n\n}<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Click <strong>Update File<\/strong> to save the changes.<\/li>\n<\/ol><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>The <strong>admin-ajax.php<\/strong> file&rsquo;s high usage in WordPress may significantly cause performance issues. Therefore, it is important to address this problem to improve your site&rsquo;s performance, enhance user experience, and reduce server load.<\/p><p>In this article, we have discussed factors that lead to high usage of <strong>admin-ajax.php<\/strong>, such as excessive plugin usage, high traffic volume, and inefficient database queries.<\/p><p>You have also learned how to troubleshoot this AJAX script file issue using GTmetrix and Chrome Developer Console.<\/p><p>As for reducing the high usage of your WordPress site&rsquo;s <strong>admin-ajax.php<\/strong>, here is a recap of the three methods:<\/p><ol class=\"wp-block-list\">\n<li>Disable WordPress plugins.<\/li>\n\n\n\n<li>Enable website caching.<\/li>\n\n\n\n<li>Control WordPress heartbeat API.<\/li>\n<\/ol><p>We hope this article has helped you understand how to reduce the high usage of <strong>admin-ajax.php<\/strong> on your WordPress site. Good luck on your online journey!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Asynchronous JavaScript and XML (AJAX) is a set of web development techniques that enhances a website&rsquo;s user experience and interactivity. WordPress theme and plugin developers commonly implement AJAX to create dynamic and interactive features. Moreover, AJAX allows site visitors to submit a newsletter form or comment on a blog post without reloading the web page. [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ng\/tutorials\/how-to-fix-admin-ajax-file-in-wordpress\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":258,"featured_media":145164,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Resolve High admin-ajax.php Load","rank_math_description":"High load in the admin-ajax.php file slows down your website. Learn how to resolve the issue by managing your plugins and the Heartbeat API","rank_math_focus_keyword":"admin-ajax.php","footnotes":""},"categories":[22637],"tags":[],"class_list":["post-15351","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-fix-admin-ajax-file-in-wordpress","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/corrigir-erro-admin-ajax-wordpress","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/admin-ajax-php","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/reducir-carga-admin-ajax-php-servidor-wordpress","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/admin-ajax-php-wordpress","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-fix-admin-ajax-file-in-wordpress","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-fix-admin-ajax-file","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-fix-admin-ajax-file","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/reducir-carga-admin-ajax-php-servidor-wordpress","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/reducir-carga-admin-ajax-php-servidor-wordpress","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/reducir-carga-admin-ajax-php-servidor-wordpress","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/corrigir-erro-admin-ajax-wordpress","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-fix-admin-ajax-file-in-wordpress","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-fix-admin-ajax-file-in-wordpress","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-fix-admin-ajax-file-in-wordpress","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-fix-admin-ajax-file-in-wordpress","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/15351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/258"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=15351"}],"version-history":[{"count":49,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/15351\/revisions"}],"predecessor-version":[{"id":145163,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/15351\/revisions\/145163"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media\/145164"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=15351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=15351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=15351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}