The most important procedures for speeding up a WordPress website Comprehensive guide

that you need to take into consideration, and strive to improve it continuously, and this is what we will learn about today. I will explain to you some recommended improvements to make in order to obtain faster speed of your site, as well as a better user experience.

Prepare your favorite drink now to start reading this detailed guide, which shows you all the procedures to improve the speed of your site 🙂


The importance of site speed

There are many benefits that will accrue to your site if its speed improves significantly. However, the loading time will be shorter for the visitor, but there are more benefits that your site will receive after its speed improves, which are as follows:

  • Improved ranking in search engines: Google disables priority in appearing in search results for sites that have a higher loading speed than those that take longer to load.
  • Better experience for your site visitors: There are many studies conducted that show the possibility of losing a large number of visitors to your site if the site’s loading time increases. Therefore, in order to preserve this valuable wealth of visitors, you must give the matter full attention. 
  • Better experience for online store owners: Online shoppers prefer online stores that fulfill their purchases in record time, so this is also important for you if you are an online store owner. 

The most common reasons for a slow WordPress site 

  • Choose unstable or incorrectly configured hosting. 
  • Using a bad WordPress template is not designed in the best way to help speed up the site.
  • Installing add-ons that are not optimized or not programmed in the best way.
  • Using large pages that contain files, images, or videos that are not ideally formatted.
  • Calling external files within the site External Scripts. 

How do you test your site speed?

Site speed is not measured by the speed you see when browsing your site, because you open it repeatedly all the time. A ready copy of your site’s content is stored by the browser, and then the browser displays that saved copy when you enter your site. You find that the site is fast, but it is not the real speed of the site. .

But for regular visitors (especially new visitors), they browse the site at its real speed, and therefore we advise you to use some tools to know how the site speed will be for users, which are as follows:

  • isitwp is a tool to measure website loading speed and provide tips on improving speed. 
  • gtmetrix tool that helps you analyze site speed and gives you a full report of some recommendations to speed up your site.
  • Page speed tool from Google, which provides a percentage rating of site speed and provides some recommendations for improving site speed. 

Also, here is the following image showing a site being tested using one of the speed measuring tools. As you can notice, the site loading time appears as 1.17 seconds, and a link also appears containing suggestions on improving the site’s speed.

Most of the time, you open these suggestions and do not understand what is required of them, especially if you do not have a programming background! . But after reading this article, everything will be completely clear for you to improve your site’s performance step by step.

Note : If your site’s loading time is more than 2 seconds, it is necessary to optimize your site speed for less than that time.


Speed ​​improvement by the hosting provider

The process of improving site speed begins by choosing reliable hosting for your site, as your site is directly affected by the resources of that hosting, its stability and speed of performance, so you must invest well and choose the appropriate hosting.

Shared Hosting

Shared hosting is considered the most widely used among users of emerging and small websites, and it is called shared hosting because in this case the hosting company divides the server resources into a large number of shared hosts and sells them individually to a number of customers.

Shared hosting often fails to provide high site loading speed and complete stability if there is a large number of visits within the site.

If you intend to create a website for a large business that has many financial and technical dimensions, we do not recommend this type of hosting, because your site will be vulnerable to any error that occurs on the server that contains it within the hosting company, and a problem may occur with your site due to a crash or the occurrence of something suspicious. On some other sites hosted on the same server. 

This does not mean that you should start using shared hosting, but make sure that the company you are dealing with is reliable, and that the company has stable and strong systems and provides periodic software updates, as well as continuous technical support and backup services. By taking into account the recommendations mentioned in the article, you will find better performance of your site.

Now here are the most important steps that you need to ensure from the hosting service provider, as they are the basic ones you rely on for website speed:

1.Choose a reliable hosting company

The first thing you care about is relying on a reliable hosting service provider, whether in terms of the reputation of the company you are dealing with or in terms of its history with the customers who dealt with it in the previous period. The more confidence there is among users in the efficiency of the hosting provided by the company, the more it is expected. That you too get a better experience from the service provider.

2. Get the latest version of PHP

PHP is the source programming language in which the WordPress system was built and established. It is also used to program templates, plugins, and the entire WordPress operating system . 

Every period of time, a newer version of PHP is released, which includes solving many of the problems in previous versions. So make sure that your hosting company provides PHP version 7 to later. 

3. Support Http/2 protocol

The HTTP/2 protocol is considered one of the protocols that helps significantly improve the speed of your site. If the hosting company provides it to you, it will be reflected in the performance of your site, as the HTTP/2 protocol, which was launched in 2015, allows the transfer of information in more flexible ways and in less time. This is reflected in the loading speed of your site. 

4. Choose the server closest to your site visitors

Many hosting companies provide the ability to choose a server in a specific geographical area. In this case, we advise you to choose the server that is located in the place closest to your site visitors. For example, if you are targeting visitors from the Arab Gulf countries, it is better to choose a server located in “Bahrain,” for example, instead of a server located in the “United States.”

 Of course, this is if the hosting company provides servers in that country. In all cases, choose the location closest to your visitors. Likewise, the server located in one of the European countries may be closer to the visitor to your site than the server located in Australia. This easy and simple procedure can greatly affect the loading speed of your site.

Note : You can know the countries that bring you the most visits to your site by using many statistical services such as Google analytics, and then you can determine the most important regions from which visitors to your site come and thus you can determine where your site should be hosted so that it loads faster for the most important visitors. 


The most important tips to increase the speed and performance of the site

WordPress consists of many pages, files, and add-ons, which may constitute a large burden on sites, and therefore you need to organize the structure of the site and deal with it in a way that helps in loading and appearing your site to the visitor in the shortest possible time. 

Now we begin to explain all the necessary procedures for you to speed up your WordPress site to the highest possible degree of speed in performance and appearance. 

1- Customize cached files

Storage files, or what is called “cache,” are files that are generated automatically when any visitor accesses your site, for the purpose of quickly displaying the site’s contents if the visitor accesses the site for the second, third, or fourth time of his visit. Therefore, cache files help improve the loading speed of your site for visitors who visit the site repeatedly, instead of consuming your site’s server resources in fetching all the files and data to display to the same visitor more than once.

As you can see in the picture, the first step is when the visitor enters your site. The second step begins where the cache files are automatically generated and stored on the visitor’s device. The third step comes when the visitor repeatedly enters the site again. The cached copy of the site is loaded very quickly. This makes your site appear much faster than usual.

This means that you must configure cache files on your site, and of course there are many free add-ons that help you do this task easily through simple steps.

As for free add-ons, there are many add-ons that you can use completely free of charge, such as the Wp Super Cache add-on or the W3 Total Cache add -on. After installing and activating the add-on, the add-on generates cache files automatically for visitors who visit the site continuously.

You can also try Cloudflare’s free add-on, which is the Wp cloudflare add-on , which provides the service of automatically generating cache files for website visitors.

There are also “paid” add-ons that provide higher features to speed up the site in addition to generating automatic cache files, such as the Wp Rocket add-on , which provides you with some additional options, such as delaying the loading of images within the pages of your site, or what is known as Lazy load images, and also provides services CDN, which we will talk about in some detail throughout the article:.

Note : There are some hosting companies that provide cache services automatically and completely free of charge with the hosting plan that you are working on. In this case, you will not need to add WordPress to do this. Rather, what you need if your hosting supports the creation of cache files is to enter the settings. Your hosting is in your account with the hosting company and you activate the Cache files feature.

For example: Bluehost provides this feature. You can activate the feature by logging into your account, then going to My Sites, then the Performance tab , then activating the Cashing options as shown in the following image:

In this case, you will not need to add a WordPress plugin to create and manage cache files. 

Also, if you subscribe to one of the hosting companies that provide pre-managed WordPress sites, these companies often provide an automatic cache file system, so whatever company you work with, if they provide you with automatic caching options, you will not have the need to install a plugin. Customized for that. 


2. Optimize and adjust image sizes on the site

Images are considered one of the elements that most need to be configured on your site, because your site will not be devoid of the fact that it contains many images, on most of its pages. If the image is many and large in size, this will negatively affect the speed of your site.

You can control the image size through Photoshop, or perhaps you can use the Tinypng tool , which helps you reduce the image size by uploading it to the website. Then the website compresses it without losing its quality and uploads it at the smaller size.
As in this example, the image size was compressed by 73%.

We recommend using images with the JPEG or PNG extension, preferably JPEG. If there is no need for other extensions, you can also rely on some free WordPress plugins that provide options that improve the appearance of images within your site. One of the most famous of these plugins is Autoptimize , which provides the Lazy load images feature that helps web pages load and appear first, and then Uploading images sequentially, one after the other, which helps speed up the loading of the site for the user.

There are also some add-ons that are used to delay the loading of comments. Lazy load comments, where the comments are hidden and not loaded once the site loads, but rather they are loaded automatically if the visitor reaches the comments section at the bottom of the site. 

This procedure benefits owners of large websites that contain thousands of comments, which helps reduce the number of comments displayed on the same page, thus improving its performance. As for small sites, there is no need to use the Hide Comments add-on because it will not have a significant impact.

To delay the loading of comments, you can use the Lazy load comment  plugin

After installing and activating the plugin, you can access its settings through the WordPress Control Panel << Settings << Discussion

As you can see in the picture, you will find 3 options as follows: 

  • The first is On Scroll: When selected, the comments will be hidden and shown once visitors scroll through the site and reach the comments section. 
  • The second is Onclick: When selected, the comments are hidden and the “Show Comments” button is shown. When pressed, the comments begin to download and appear. 
  • Third: No lazy load: When selected, the add-on will be turned off. 

You can also use the Smush add- on to optimize images and media files, as the add-on adds many image optimization options such as: 

  • Lazy load technology to delay the appearance of images until the visitor reaches them 
  • Lossless Compression feature
  • The ability to compress a number of images, up to 50 images, with one button press at the same time.
  • The add-on scans the site’s images and identifies the images that cause the site to load slowly. 
  • The add-on has a free version with some good features 

3. Get the latest updates

Updating WordPress is considered one of the most important practices that not only helps enhance the site’s loading speed, but also maintains the security of the site and its information , as WordPress updates always come in order to solve the problems that users were facing in older versions. 

For example, when WordPress 4.2 was released, it came with a technology that helped website owners improve the loading speed of their sites in an unprecedented way, as the performance of the JS JavaScript codes within the site’s menu rules was improved. 

Thus, the rest of the updates come in order to provide speed and security options for the site, which makes it necessary to continuously update the version of WordPress and all site files.


4.Be careful with add-ons running in the background

There are some add-ons installed on your site that work in the background and consume your site’s resources, thus increasing its loading time for visitors. 

Of course, this situation occurs, for example, when you install an add-on that performs many functions within your site, for example add-ons that take backup copies of your site continuously and extensively. The operations carried out by those add-ons clearly affect how quickly your location. 

Therefore, it is a good idea to make sure that the backup copy add-on you use makes backup copies at times when there are not large numbers of visitors. This will be beneficial in the efficiency and speed of loading your site.


5. Adjust the display of a summary of articles instead of displaying their full content on your site pages 

WordPress automatically displays the full content of articles on the home page or archive page of your site, and certainly automatically displaying the full content of articles causes an increase in the site’s loading time, as these articles contain many image files that may make the loading time much longer than usual. . 

Therefore, activate the option to display a “summary” or section of the content instead of displaying the entire content, which shows an excerpt of the content, and the visitor can review the full content of the article by clicking on the article title easily. 

To activate the option to display the summary or summary, log in to your WordPress site’s control panel, then go to Settings << Reading , then at the “For each article in the summary include” option, you will select a summary (summary).

You can also contribute to increasing the loading speed of your site by displaying a smaller number of topics on one page, for example displaying only 10 articles, and the visitor can access the rest of the articles by scrolling the navigation bar between the pages.


6. Set a maximum number of comments displayed within one page

If there are many comments that appear below one of the articles or pages of your site, and every time a visitor enters this page, all the huge amount of comments within the page are called, which makes the site take more time to load and appear in front of visitors. The solution to this is to set a maximum limit on the number of comments that appear below your articles or pages, and then divide the rest of the comments into multiple pages. 

To activate the option to divide the number of comments that are displayed, go to the WordPress control panel for your site, and from the bottom of the settings tab, choose << Discussion ” and then “Specify the number of comments on one page,” and for example, it should be a maximum of 50 comments. Older comments will be divided into other pages for the user to navigate

Note: This procedure is for large sites that contain tens and hundreds of comments. As for small sites, there is no need to do this procedure.


7. Link your site to CDNs

We also explained that the location of the server will affect the speed of browsing the site depending on its location for visitors. Therefore, if your site visitors are distributed across different countries of the world, the speed of the site will vary depending on how visitors approach or move away from the server location.

For example, if your site is hosted on one of the servers of a company in the United States of America, this helps visitors from the United States access your site more quickly than visitors from Egypt due to the long distance between Egypt and the United States. So, the geographical distance of the server from the visitor contributes to the site loading time for the user, and this explains the speed of loading sites for all visitors in the countries where the most famous web hosting companies are located. 

CDNs and their role in accelerating the website

As we talked about cache files at the beginning of the article, CDNs work with an idea similar to the idea of ​​cache files, where an exact copy of your site is uploaded to a large group of servers in different places in the world. For example, a copy is stored on a server in the United States. And also on a server in Kuwait. 

In this case, if a visitor from the State of Kuwait accesses the link to your site, the copy of the site stored on the server located in the State of “Kuwait” will be downloaded to the visitor instead of the copy stored in the “United States.” This greatly contributes to improving and speeding up your site.

There is more than one CDN service provider around the world, and some of the most famous service providers can be mentioned, such as Cloudflare, which provides one of the most famous CDN services: 

There is also Stackpath (formerly MaxCDN) which provides CDN services as well


8. Upload large video and audio files to an external provider 

WordPress allows you to upload video and audio files to your site’s content and embed it directly, but we do not advise you to do so, especially for large files, as this consumes hosting space and also increases the time it takes to upload the file.

Instead of uploading video and audio files directly to your site, you can upload those files to YouTube (or any external provider), and then embed the video directly on your site so that the video plays within the content without consuming any of your site’s resources.


9. Choose the perfect template

The WordPress template is one of the pillars of building your site. It is responsible for customizing the site’s appearance and adding features at times, so choose the template that best suits you very carefully, taking into account security, speed, flexibility, and programming the template well. Here are the most important tips for choosing the right WordPress template for your site: 

  • Good performance : Ideal templates are simple and uncomplicated, so do not be fooled by templates that provide you with dozens of add-ons and options that you do not urgently need, in addition to the fact that they constitute a large burden in consuming your site’s resources.
  • Responsiveness : In our modern world, you no longer have an option to make your site responsive to all types of screens, such as tablets, mobile phones, and various screens, so make sure before installing the template on your site that it is responsive. You can test the template before installing it to ensure that it is compatible with all types of screens by using one of the tools, the most famous of which is Google Mobile Test.
  • Template compatibility with plugins: Make sure before installing the template that it is compatible with the most important and popular plugins that you will install and use within your site. Some templates are not compatible with certain plugins, which causes site loading problems and other security-related problems. 

Therefore, choosing a professionally programmed template fundamentally affects the speed of your site.


10. Delete unused and inactive templates and plugins 

It is possible that there are some add-ons on your site that are not activated and you do not need them. In this case, it is best for you to permanently delete those add-ons from your site, and remember that any files that you do not need constitute an additional burden on your site. So get rid of things that you don’t need constantly. 


11 . Removing junk data from databases

When you delete an article or page or delete any content from your site, it is automatically stored inside the databases so that you can recover it later if you want. Therefore, if you delete large amounts of content within your site, there is a copy of it inside the databases and it constitutes an additional burden on your site. Thus affecting its speed.

The solution is to clean the databases from these files and junk content, and you can do this by using some custom add-ons such as the Wp-sweep add-on.

After installing the plugin, you can access its settings from within the WordPress control panel, then go to: Tools << Sweep

td Inside the add-on settings page, you will find many things that have been deleted from your site and still exist and are stored within the site’s databases, as you can see in the picture those things such as content reviews, drafts, deleted articles, spam comments, deleted comments, duplicate content, and dozens of things. Unimportant ones, which you can delete by pressing Sweep directly. 

 


Make some advanced settings

In the previous sections, we reviewed the most important simple steps that do not require you to write a code, and that do not require you to learn some advanced techniques or skills. Indeed, all of these steps have a lot of impact in improving the speed of your site well. 

However, in this part, we will focus on some advanced things that double the process of improving site speed, but we advise you to be careful while making these modifications, because any error in them may cause a complete failure of your site.

Note : We advise you here to take a backup copy of your site files and databases before making any changes to the code within your site in anticipation of any malfunction that may occur. 

1. Divide the content of your long site articles and pages into multiple pages

Do you have an article on your site that exceeds 5,000 words or perhaps more?! Yes, in this case, a large amount of data, images, and comments will be uploaded to your page every time the visitor accesses that page. 

In this case, we advise you to divide that content into multiple pages, so that the visitor clicks on one page after another in order to see the rest of the content of the article or page. 

To divide the content of your articles or pages, you may enter the page for editing the article whose content you wish to divide, and on the editing page, open the “Text” tab to open the HTML code editing page for you (this is if you are using the traditional editor). 

If you are using the “Gutenburg” component editor, you can open HTML editing by opening the editor options and choosing “code editor,” as the following image shows: 

Browse the content of the article until you reach the part you want to separate and divide the rest of the content on a new page, and put the following code: 

< !–nextpage– >

If the code does not work perfectly, you can place the cursor at the place you want to separate and press Ctr+Alt+b on the keyboard, and you save to notice that the content of your articles has been divided into two pages instead of one page, and you can increase the number of divided pages by adding the same tag in any A place where you want to disconnect. 


2. Reduce database queries

WordPress was built in a dynamic way, so that all commands on the site are executed even if the site data changes from time to time. Meaning that there are dozens and hundreds of programming functions, each of which performs a specific function when a visitor enters the site. For example, there is a function called language_attributes, and this function brings the display direction of the site’s components, whether from right to left or vice versa, based on the default language of the site. Which was chosen during the WordPress installation phase, or was customized from the WordPress settings after it was installed.

Note the following code:

< html xmlns= "http://www.w3.org/1999/xhtml" dir= "" >

In the previous code, the function <?php language_attributes(); ?> Make a query to the database in order to find the default language of the site. Imagine that a million visitors enter your site daily, and every time a visitor enters the site, the function is run that runs a query within the databases to search for the language of your site, and ultimately the language of the site. It is something that is fixed and can be added to the previous code without having to run a query function on the database in order to get the same thing every time! 

The code can be modified to: 

< html xmlns= "http://www.w3.org/1999/xhtml" dir= "ltr" >

Notice the difference is that the function <?php language_attributes(); ?> With the value “ltr” only! 

LTR indicates that the direction of the site is from left to right, but if your site is in Arabic, the definition RTL can be used. 

In the end, you provide the value of the constant that the function makes dozens and perhaps thousands and millions of queries to the databases in order to obtain. Therefore, when database queries on your site decrease, this will be reflected in the speed of your site. 


3. Reduce the number of saved revisions

WordPress automatically saves incomplete modifications to your site, and copies of those modifications are stored within databases, which may be large amounts of content, images, videos, etc. It creates additional size and consumes your site’s resources as well, and in the end this may affect the site’s loading speed. 

Therefore, it is important to reduce the number of copies saved within your site to a minimum, and you can see how to reduce the number of copies saved automatically through the Wp-config file . 


4. Block external sites from hotlinking your site files

Some competitors may steal images from your site and include them on their sites via a link. In this case, that image is uploaded within their site, but it consumes your server data, and thus affects the performance of your site.

This process is called Hotlinking, and it consumes a lot of your site’s resources and causes the site to slow down and possibly crash if there are large numbers of external Hotlinking queries to your site. 

We advise you to learn how to block external sites from Hotlinking using a .htaccess file. 


5. Cancel Pingbacks

Pingbacks in WordPress are a technology that sends notifications to other website owners who have added links to their sites within your site, and also receives notifications from those who have published links to your site. 

Of course, this is not useful in WordPress and constitutes an additional burden on the site’s speed, because it performs queries from within the databases. Therefore, you can access information linking your site to other sites through the Google search console service as well as Google analytics. 

To disable these notifications, you can go to the WordPress control panel, then go to Settings << Discussion , then uncheck the “pingbacks” option, as the image above shows. 


6. Change the MyISAM storage engine within database tables 

When you enter the database manager PHPmyadmin and open a database to view the tables inside it, you will find the figure in the image above, but notice that the shaded red indicates Storage engine, and in this case its type is MyISAM. So what’s the problem?! 

The problem is that the MyISAM storage engine is rather old, and there is a newer type of it called InnoDB. This type of database storage engine has been proven by many studies to help speed up the site significantly. 

The reason the InnoDB type is best for your databases is that it uses a query known as row-level locking, while the MyISAM type uses a query known as full table-level locking. 

What is useful in the InnoDB type is that when a query is requested from one of the pages of a website to specific data within a table in the databases, only the required data is loaded, while in the MyISAM type the entire table data is loaded, which causes additional loading time for your site. 

How do I change the data storage engine from MyISAM to InnoDB?

Log in to the database manager and choose the database that contains the data tables for your site. 

Then, enter the table whose storage drive type you want to change. For example, we enter the table shown in the image wplw_comments, which opens the table settings page for us: 

Go to the “Operations” tab and the Storage engine part will appear in front of you: 

Open the checkbox and choose InnoDB instead of MyISAM. 

You can repeat the steps for the rest of the tables for which you want to change the storage drive in the same way. 


In the end, we hope that we have clarified all the important things to improve the loading speed of the WordPress website to the maximum possible degree. We assure you that you should not pay attention to one of the improvement factors and neglect the other aspects, for example, paying attention to choosing well-optimized hosting and neglecting matters related to WordPress additions and updates. Caching and other technical matters such as blocking Hotlinking and reducing database queries. We certainly do not advise you to perform procedures that require modifying the code unless you have sufficient programming experience to do so. We also advise you to take a backup copy of the site before making any software change. 

We wish you all the best and we will see you in the next articles as you have a faster and more efficient website 🙂 

Avatar photo
I am a young man who has been working in WordPress and e-marketing for 10 years. I would like to share my experience with you so that we can become professional in WordPress I will be happy to share the experience with you.