What is WordPress Heartbeat and How to Reduce admin-ajax.php Hits

/ Category: Tutorials / Comments: 4

what is wordpress heartbeat and how to reduce admin-ajax.php hits

WordPress is the most popular CMS in the world. They released the initial version of WordPress in 2003. It introduces new features every year. On August 1, 2013, WordPress Heartbeat was initially introduced in WordPress version 3.6. It allows your browser to communicate with the server when you are logged into the WordPress dashboard.

WordPress Heartbeat offers great functionality, it helps in post revision tracking, auto-saving of posts while composing, and user session management. WordPress Heartbeat sends a continuous pulse, as the name indicates, using AJAX calls to perform periodic tasks. In this article, we will explain what is WordPress Heartbeat and how to reduce admin-ajax.php hits.

What is WordPress Heartbeat

WordPress Heartbeat API is a tool that allows WordPress developers to make use of AJAX in a unique way. The pulse system will automatically tick or beat every 15-60 seconds and utilize the file admin-ajax.php on the website, for example, to check if someone who logged in to the dashboard is still active or not, to check if something has changed or not, etc.

The great functionality offered by WordPress Heartbeat is awesome. WordPress can keep track of what is going on in the website back-end and front-end. But, in some cases, this functionality can increase your server’s CPU usage and slow down your websites due to an excessive number of requests to admin-ajax.php.

At one point, you feel that your website is extremely slow, even after upgrading your hosting plan, optimizing the database, etc. Upon checking, you find out that there is an excessive number of requests to your admin-ajax.php file. Your hosting support would say that your WordPress website consumes a lot of CPU due to the high number of requests to admin-ajax.php.

While helpful, numerous admin-ajax.php requests can sometimes trigger high CPU usage. This will lead to performance issues and search engines do not like slow websites as well.

How to Reduce admin-ajax.php Hits

If you host your WordPress websites on a server with cPanel or DirectAdmin control panel, you can check the server report tools like AWStats, and you would see a lot of requests to your admin-ajax.php. The excessive number of requests would make your sites slow and could lead to account suspensions if they are hosted on shared hosting.

Completely disabling WordPress Heartbeat not only will break the connection between your web browser and server, but also you will lose great features like auto-saving posts and revisions, session management, etc. These are the disadvantages of completely disabling WordPress HeartBeat.

  • We would not be able to see realtime information about something if a plugin uses or relies on the WordPress HeartBeat to work properly. For example, the WordPress Site Health tools relis on WordPress Heartbeat. The tool will not return any results if we disable Heartbeat.
  • Automatic posts/revisions saving would not work, we would need to manually press the ‘Save Draft’ button to save our works.
  • Heartbeat APi also inlcudes post locking feature, with this feature only one person can open a post that currently being edited.

So, according to the disadvantages of fully disabling WordPress Heartbeat above, it is recommended to limit or reduce the WordPress Heartbeat instead. To limit or adjust the Heartbeat API frequency, we can use the Heartbeat Control plugin.

Install Heartbeat Control

To proceed with this step, make sure you have administrator access to your WordPress website. If yes, log in as an administrator to your WordPress dashboard then navigate to Plugins – Add New.

In the keyword field on the right, type heartbeat then you will see the search results. Choose the plugin as shown in the picture below.

what is wordpress heartbeat and reduce admin ajax php hits

Click on the Install Now button to proceed with the installation.

After completing the installation, do not forget to click on Activate Now button to activate it and start configuring it.

Configure Heartbeat Control

Now, we have successfully installed the plugin, and to modify the Heartbeat frequency you can go to Settings – Heartbeat Control.

reducing admin ajax php hits with wordpress heartbeat

In the General settings tab, you can change the setting to allow or disallow Heartbeat. But now, we are going to change the default Heartbeat frequency. To do this, you can click on the ‘Modify Heartbeat’ radio button and slide it to any values you like, in this article we will set them all to 300 seconds.

what is wordpress heartbeat and reducing admin ajax php hits


Finally, after modifying the heartbeat frequency, do not forget to click the Save Changes button.
By saving the new setting you will override the default Heartbeat frequency with the value you set on the Frequency slider options.

Please note, if you already have the WP-ROCKET plugin, you do not need to install this Heartbeat Control plugin because the WP-Rocket plugin has this functionality already.

That’s it. You have learned about WordPress heartbeat and how to reduce admin-ajax.php hits in this article.

If you are one of our web hosting customers and use our optimized WordPress Hosting, you don’t have to do all these by yourself, our expert Linux admins will set up and optimize your WordPress VPS for you, including but not limited to reducing the admin-ajax.php hits. They are available 24/7 and will take care of your request immediately.

PS. If you liked this post, on how to WordPress Heartbeat and how to reduce admin-ajax.php hits, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Why AlmaLinux is a Good Choice as a Web Server OS?

/ Category: Tutorials / Comments: None

why almalinux is a good choice as a web server os

In this tutorial, we are going to explain what are the benefits of using AlmaLinux and why it is a good choice as a new web server operating system.

using almalinux as a web server os

AlmaLinux is a free open-source Linux distribution created by CloudLinux to provide community support successor for CentOS Linux. The first stable version of AlmaLinux was released on March 30, 2021. According to the official announcement from CloudLinux, AlmaLinux will be supported until 2029.

In the next paragraphs, we are going to explain more about the meaning of AlmaLinux, the beginnings, the supported migrations to AlmaLinux, its pros against the other OS such as CentOS, Ubuntu, Debian, etc. Let’s get started!

How to Install Odoo 14 on Debian 11 with Apache as a Reverse Proxy

/ Category: Tutorials / Comments: None

How to Install Odoo 14 on Debian 11 with Apache as a Reverse Proxy

Odoo (formerly known as OpenERP) is a suite of open-source business applications. The most used modules for Odoo include Point of Sale (POS), Inventory, CRM, Website, Live Chat, e-Commerce, Billing, Accounting, Warehouse, and others. The range of the modules that can be installed in one application makes Odoo very popular nowadays.

installing odoo 14 on debian 11 with apache as a reverse proxy

Let’s learn how to install and start using Odoo 14 on a Debian OS. Remember, if you want to skip this part and let others automate it for you, you can do so by subscribing to any Debian hosting plan and acquiring all the assistance you’ll ever need. In this tutorial, we will show you how to install Odoo 14 on Debian 11 with Apache as a reverse proxy.

How to Install OpenEMR on Ubuntu 20.04 with a LAMP Stack

/ Category: Tutorials, Ubuntu / Comments: None

how to install openEMR on Ubuntu 20.04 with a LAMP stack

OpenEMR is a popular open-source software for the healthcare industry. It offers electronic health records and medical practice management solutions. OpenEMR provides a fully integrated Workflow Management inside healthcare facilities. Any healthcare facility would be able to capture and control patient data using the following features in OpenEMR.

  • CMS Reporting
  • Lab Integration
  • Clinical Decision Rules
  • Advanced Scheduling
  • E-Prescribing
  • Advanced Security
  • Multilingual Support

OpenEMR runs on many platforms, including Linux machines. In this tutorial, we will show you how to install OpenEMR on Ubuntu 20.04 with LAMP Stack.

How to Install PrestaShop on Ubuntu 20.04

/ Category: Tutorials, Ubuntu / Comments: 3

how to install prestashop on ubuntu 20.04

In this tutorial, we are going to show you How to Install PrestaShop on Ubuntu 20.04.

PrestaShop is an open-source eCommerce platform written in PHP, that uses MySQL as a database server to store the information. It helps individuals or small business companies to raise their online shop and is very intuitive to use with its simplicity and easy features that you will discover after the installation. In this installation, we are going to explain every step of installing the LAMP stack because it is necessary for the PrestaShop to work properly.

How to Install Rocket.Chat Server for Team Communication

/ Category: Tutorials / Comments: None

how to install rocket chat server for team communication

Communication is one of the most important pillars of every company. There are solutions for business needs or for corporate use, such as Rocket.Chat, Slack, Hangouts, Flock, as well as messengers for everyday communication, such as Skype, WhatsApp, Telegram, and others.

install rocket chat for teams

Currently, Rocket.Chat is one of the most popular and widely used team communication apps available. How can you set things up and start using this tool for your team? In this article, we will deploy Rocket.Chat server in a Cloud PaaS environment. You’ll set up a custom domain, and we’ll secure our application with an SSL certificate.

How to Install Memcached on Ubuntu 20.04

/ Category: Tutorials, Ubuntu / Comments: None

how to install memcached on ubuntu 20.04

We’ll now walk through the installation of MemCache on our Ubuntu 20.04 environment. The very basic definition of what Memcached is is as follows. Memcached is a free and open-source program that eases the re-extraction of information from a database with an object caching program, which allows for PHP-based apps such as WordPress and Joomla to run smoothly without much latency. In other words, it helps with the database loads, since the re-extraction of information is much easier.

install memcached on ubuntu 20.04

Many users have issues installing Memcached on an Ubuntu 20.04 OS. We have decided to create a tutorial, where you can manually install and activate Memcached on your Ubuntu 20.04. Make sure to follow all steps below in order to succeed. In case you are stuck somewhere, feel free to ask away in the comments section, at the very end of this tutorial. Alternatively, subscribe to a fully managed VPS hosting plan, and let our expert customer support take care of things for you.

How to Install NGINX on Ubuntu 20.04

/ Category: Tutorials, Ubuntu / Comments: None

How to Install NGINX on Ubuntu 20.04

In today’s tutorial, we will guide you through the steps of installing Nginx on Ubuntu 20.04. Nginx (pronounced as engine x) is a free and open-source web server designed for maximum performance, stability and scalability. It can be also used for caching, reverse proxying different protocols, load balancing, media streaming, etc.

Nginx is used by more than 30% of all active websites, which makes it one of the most popular and widely used web servers in the world. It is used by some of the well-known companies such as WordPress, GitHub, Cloudflare, Dropbox and Netflix.

How to Install PHP 8 on Debian

/ Category: How To, Tutorials / Comments: None

How to Install PHP 8 on Debian

The following tutorial guides you step by step through the process of installing PHP 8.0 on Debian 10. PHP is an open-source general-purpose scripting language, mostly used by web developers as it can be easily be embedded into HTML.

installing php 8 on debian

PHP version 8.0 was officially released on November 26, 2020, and it is the latest release of the PHP language. It is packed with lots of new improvements, features, and optimizations including named arguments, attributes, constructor property promotion, JIT (Just in Time Compiler), match expression, union types, null safe operator, better error handling, improvements in the type system, and consistency. Also, according to multiple tests, PHP 8.0 can handle much more requests per second, compared to the older versions of PHP, so if your PHP-based website or application is fully compatible with PHP 8.0, you should definitely consider upgrading to the latest version.

How to Install Django on Ubuntu 20.04

/ Category: Tutorials, Ubuntu 20.04 / Comments: None

how to install django on ubuntu 20.04
installing django on ubuntu 20.04

Django is a free and open-source, Python-based web framework that allows developers to quickly and efficiently create feature-rich, scalable, and secure web applications. Django web framework is built by experienced developers and used, tested, and enhanced for more than a decade by a very active community. It is used by some of the largest websites and online communities around the world, which makes it one of the most popular and widely used full-stack Python web frameworks.

In this tutorial we will guide you through the steps of installing Django on an Ubuntu 20.04 VPS.