How to Speed Up WordPress

Share this article

Here is my guide on how to speed up WordPress, I reveal all my secrets

In this article today I am going to explain what interventions need to be done to increase the speed of WordPress until you reach loading times close to one second. It will be possible to achieve this by following to the letter all the tips I will explain on this page. Even my website uses these techniques, and because of this increase, I was able to improve the speed and consequently the Google ranking of my website.

Surely before you got to this point you already noticed the length of this page and perhaps, this very page, did not load very fast because of its length. So I will take this opportunity to point out to you that the length of a page, the number of images, and multimedia elements can affect loading times.

Nevertheless, I recommend that you do not skip any part of this guide on how to increase the speed of WordPress as only by following all the steps will you be able to arrive at the desired results. Remember that if you have any problems at any point in my guide you can ask for help through the email support@gianlucagentile.com or write or call me through the contacts on the website.

1. Do you use a good hosting? Here are the best hosting providers for WordPress in the UK

The first thing we need to analyze to increase the speed of our website is hosting, that is, web space. Many provider have learned to create ad hoc services for WordPress in order to integrate optimizations that can increase the speed, and in some cases even the security of your website.

Using a dedicated web space for WordPress is already a good starting point to get decent speed even without special arrangements. I personally recommend three providers, which are:

These are the providers that I have been using for years and consider to be the best on the market. Of course there are many others that I consider to be good but from my experience of use I have to consider these three the best.

The providers I use differ simply on a quality/price basis.

The web space I use for my website is Siteground with Googeek web space. Thanks to the optimization done by the provider I am able to increase the speed of WordPress and have excellent loading times even for projects that have not been optimized.

I used the word projects because Siteground allows multiple projects to be installed on the web space simultaneously. This is recommended for those who manage multiple websites or otherwise want a fast and efficient service.

2. Increase WordPress speed: use a premium template versus a free template

After registering our website and installing WordPress surely the first expedient we must have concerns the template we want to use or are using. Certainly many people use free templates to save the cost of licensing.

Free templates many times are created as a hobby by developers or with limited features that may have deficits in terms of speed or even code cleanliness. This greatly affects the loading time of your website as the Template is one of the main things we can find inside WordPress.

I highly recommend getting a premium template for your website. In my article I explained which are the best templates for WordPress available on Themeforest.

3. Plugins: Are you really using the right plugins? Are all plugins essential on your website?

Farsi queste due domande è una fase principale nel processo di optimization del vostro sito web per increase the speed of WordPress. Using many plugins is one of the first causes of slowness for a WordPress website.

Years ago the advent of WordPress simplified the creation of websites. To dateinfact, it is enough to install plugins to enrich our website with new features. This practice, unfortunately, has led users to install plugins without later using or choosing them carefully.

Choosing one plugin over another can greatly improve the speed of your website as the writing of a plugin and its efficiency can affect your website.

To figure out which plugins you are actually using I recommend installing a simple plugin that will help you delete outdated ones. Remember to delete the plugin after you have done the verification.

P3 Profiler the plugin created by provider GoDaddy

p3-profiler
p3-profiler
Developer: GoDaddy.com
Price: Free

GoDaddy is one of the best providers in the world. I personally don't like it very much because of its management interface, but it is known for developing very good plugins, apps and solutions.

One of them is precisely the P3 Profiler plugin. It allows us to analyze our WordPress and figure out which plugins are slowing down WordPress; and then which ones need to be deleted to increase the speed of the website.

As a reminder, if some of the plugins on your website are used to create images, text, buttons, and more, try to consider whether you can create those resources manually, or hire someone who can do it for you.

4. Use only lightweight images and optimize those on your website

The Internet is made up of text, photos and videos. Optimizing these three elements is a good practice to increase WordPress speed. Text cannot be optimized since it already is, being part of the HTML code. Except for those who use custom fonts that have not been optimized; I personally always recommend using the Google Fonts.

In recent years, videos have surpassed text and images in importance and usability. Uploading your videos to platforms such as Youtube and Vimeo saves space and speeds up your WordPress site.

The part that therefore affects the most and may seem most complicated to optimize are the images. Many people for their website use those taken from Google Images. As always I recommend taking them from dedicated laptops such as Pixabay, Envato Elements (paid) or the well-known Shutterstock (paid). This allows us to always have good quality images, but we will surely face the problem of heaviness.

To solve this problem I rely on a plugin called Imagify. This allows you to optimize images already uploaded to WordPress and also optimize them whenever we upload new ones to our website.

All very nice except that imagify requires a little subscription For the connection of an API regarding image optimizations. Of course, I recommend you to make this small monthly investment as we are talking about figures starting from 4.99$ per month. It is worth it all, as this service can increase the speed of your WordPress site by as much as 40%!

5. We use the cache to speed up our WordPress website.

If you are a website owner you have undoubtedly heard of Cache. For those of you who don't know, Cache is a tool that allows you to serve saving a web page to users. Let's take a small example:

Mario visits my website and specifically the page as speed up wordpress. He is satisfied with what he has read and when he meets with Luigi he shows from his computer the page of my website. The moment Mario shows the page he had visited a few hours earlier the cache that you will have saved will allow the page to open more quickly. Luigi when he gets home will be curious to see the page shown to him by his friend, so he decides to open the link. However, the page will open at the same speed as the first time Mario opened the page.

To manage this cache there are special plugins. For those using Netsons and V-Hosting, I recommend installing the plugin Wp Rocket , which manages to have a good cache system with very good ease of management.

For those who use Siteground the way is even easier and cheaper as the provider (which I remind you is my favorite and which I recommend for any of your projects, even if the most expensive) offers all its clients a caching plugin called SG Optimizer

Oltre a gestire la cache il plugin consente di impostare la versione di PHP che vogliamo utilizzare sul nostro server e il certificato SSL.

6. Optimize the database to speed up WordPress

If we are used to keeping our website up-to-date we will certainly need a system that frequently cleans our database.

The database is the part of our website where content such as our blog articles reside, having an optimized database can greatly increase the performance of our website especially from mobile.

To solve this problem we are met by Wp-Optimize a wordpress plugin that allows us to optimize our database with a single click and other not insignificant thing it allows us to create an automatic cleanup every week or month so as to constantly keep the website clean.

7. Enable Minify of CSS and JavaScript

Minify is a technique that allows code to be nested to be read more quickly by Web browsers.

Warning: this procedure may not make some plugins installed on your website work. The plugin that I recommend to enable this technique (but it is an option that all plugins that enable Minify have) allows you to exclude some files and therefore some plugins. This is a procedure for experienced users; if you need help, don't hesitate to contact me also by commenting on this article.

Fast Velocity Minify
Fast Velocity Minify
Developer: Raul Peixoto
Price: Free
  • Fast Velocity Minify Screenshot

Fast Speed Minify is the plugin I suggest to enable Minify. I have been trying it for a few months now and I must say that compared to more famous solutions this one performs very well.

Here is what we need to enable to improve the speed of our website with Fast Velocity Minify

  1. Let us first go to "Setting" and force the secure https protocol.
    Always force the use of the secure protocol
  2. We always stay on setting to solve some problems above-the-fold we enable the two inline all header css files
  3.  To optimize our JavaScript code we need to always move to settings and enable two features on Render-blocking JS
  4. Now let's move on to "Pro" and we activate the CSS asicrono code (in some templates this may cause display problems).

These are the steps we need to perform to improve the WordPress speed for our website with Fast Velocity Minify.

 

8. Give access only to crawlers that you actually think are valid

All search engines on the Internet (yes you heard right, there is not only Google 😛 ) use a crawler to "scan" websites and index them on their search engine.

Precisely a crawler is not really a search engine-related item. Basically it is used to take information from a website and then import it to our own website. To give you a small example, it is possible to create a crawler that takes information from X website and, via XML files, this information is uploaded to our website saving us hours or even days of work.

Many of these crawlers are not necessary for your website and many times slow it down, as they are seen as a visitor who is opening all the pages on the site. In addition to slowing down, they can falsify visitor data in Google Analytics. This is why it is important to use a method to stop these Crawlers and speed up our WordPress website.

There are 2 ways:

  1. The first is to block via .htaccess file all these crawlers. You can download a list to paste to your file from this link.
  2. The second option, although somewhat discouraged, is to use a special plugin for this function. The plugin is called "Stop Web Crawlers" and by default it blocks over 2000 crawlers and you can add more manually.
stop-web-crawlers
stop-web-crawlers
Price: Free

Start section for more experienced users on how to speed up WordPress

From this point on we will address the last three points by implementing minor changes to the WordPress configuration files to improve the speed of your website. For those who do not have knowledge on how to use FileZilla or how to edit WordPress folders or files, I recommend contacting me for assistance.

I am not responsible for any damage done to your website. If you do not have the necessary experience or confidence I recommend that you contact me first.

9. Modify the Wp-Config file of WordPress to increase the speed of our website.

One of the practices I have been using for a few years now is to edit the WordPress Wp-config file by inserting some simple instructions. These directives can improve loading speed and at the same time optimize some automatic functions of WordPress.

The Wp-Confing.php file resides in the root where we installed our website, it is not to be confused with the Wp-confing-sample.php file.

Specifically, it contains a set of instructions such as which database to read, the respective username and password, and some limitations or blocks for resource consumption.

It is a practice to back up the file before making any changes, especially if it is the first time you are using the code or this kind of intervention.

Within the file we need to include this wording:

// Start wordpress optimization
define('EMPTY_TRASH_DAYS', 7 );
define('WP_POST_REVISIONS', 5);
define('WP_HOME','https://gianlucagentile.com');
define('WP_SITEURL','https://gianlucagentile.com');
define( 'WP_MEMORY_LIMIT', '256M' );
// End wordpress optimization

I can already see someone's faces  :mrgreen: don't worry now I will explain each line what it is for and how it can be modified:

// Start wordpress optimization : this is simply a comment indicating to us or to a developer who will come after us that a configuration will begin from here on.

define('EMPTY_TRASH_DAYS', 7 ); : this command instructs WordPress to empty the trash of pages, articles, products etc.. every X days. As you can see in my case the value 7 is set but you can enter any value; if we set the value 30 the website will empty the trash every 30 days. This allows us to always have the basket empty to optimize our website space.

define('WP_POST_REVISIONS', 5); : this command instructs WordPress to keep the last 5 revisions of the post in memory. Whenever we push save draft, publish or update WordPress saves a revision, with this command we can decide the number of revisions to keep.

define('WP_HOME','https://gianlucagentile.com'); : This command makes explicit to browsers what the Home Page of our website is. We can say that it makes it clear from the start what page is to be opened. In some cases I have noticed that with this command I was able to recover a few tenths of a second of loading time, of course the website link should be replaced with yours.

define('WP_SITEURL','https://gianlucagentile.com'); : This command is identical to the previous one only it makes explicit not the home url, but the url of our website. In some cases we can have a main url and a different url of our home page. Also here you have to change my website link to yours.

define( 'WP_MEMORY_LIMIT', '256M' ); : By default many providers and WordPress itself limit memory to 64M or 124M. For some plugins or templates, larger memory is recommended. For this reason I set my website's memory to 256M so that there are no compatibility problems and WordPress loading speed is increased.

// End WordPress optimization : like the initial command this is a simple comment indicating the end of editing.

With this change applied, we can save the file.

Result of editing wp-config file to speed up wordpress

10. Enable GZIP compression to speed up Wodpress.

If you have read the article up to here and perhaps applied the changes I have explained you will surely have realized that it is all about compression and optimization. It's a bit like when you go to the dietician; so we can say that with this guide we are putting our website on a diet.

Here I am going to give you some code to implement in your website's .htaccess file. In this case there is not much to explain as the code simply compresses some files to be served faster.

The .htaccess file like the Wp-confing.php file is a very important file that we find in all websites and it is used to issue some commands to our web space, as it provides some directives to Apache.

Edit wordpress htcaccess file to speed up wordpress

Edit the WordPress htcaccess file to speed up WordPress

The code should be copied after the words # END WORDPRESS which is usually found on line 18 of the .htaccess file.

Here is the code to copy:

## ENABLE GZIP COMPRESSION ##
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
## ENABLE GZIP COMPRESSION ##

Having made this change save but leave the file open, as the next point is always about the .htaccess file.

Here is what your file will look like after htaccess file changes to speed up wordpress

Here is what your file will look like after changes to the htaccess file for speed up WordPress

11. We specify what is the expiration date of our cache to speed up WordPress.

We already talked about caching and I explained how it works. Now we are going to set up directives that assign an exact cache expiration time for each type of file.
This step is essential not only to understand how to speed up WordPress but also because I have noticed that this kind of change is very important for SEO purposes, as it greatly affects the opening speed of our website. Like the commands given in step nine I will not explain in detail what they are, but in this case I will explain that each command is going to affect the cache times of each file such as images, javascript code, pdf files and more.

Here is the code to paste below the one you put in previously:

EXPIRES CACHING ##
.
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/svg "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##

Conclusions on how to speed up WordPress

If you have reached this point in the guide, I hope you have followed all the steps I have explained. Surely you should have already noticed an increase in speed. Many of my colleagues in their guides recommend that you perform analysis tests on your website before and after performing optimization. Personally, I am against doing this kind of testing on WordPress sites since already a premium template, given the countless features it may have, is heavy for this kind of testing. In my case, even though these tests give a "B" value, or average I found that the opening of my website happens for an average of rica 3 /4 seconds, or at any rate the slowness of my website did not affect SEO indexing, as I was able to rank in front of websites much faster than mine.

Why is this? No need to optimize the website?

Absolutely we should always optimize our website for what we can. Certainly using lighter templates and as few plugins as possible can help you score very well on these monitoring tools. Since we are talking about what I recommend and my experience, I can say that by doing these optimizations you get great results without giving up functionality on your website, and especially without having compatibility problems on our website.

How to speed up WordPress, testing my website on Google's Pages Speed Insights

For those who still want to test their website, I recommend using these two sites:

  1. Pages Speed Insights
  2. Pingdom Website Speed Test

I will update this guide constantly if there should be any news in terms of plugins or manual optimizations. If you enjoyed my guide on how to speed up WordPress I ask you to leave a comment on this article or a review on my tab Google My Business

Update of 09/18/2018

Today after several updates to my website I noticed a great slowness of the whole site, it must be said that these days I am adding an average of 5/6 pages per day to my website and surely this can affect the speed of WordPress.

For this reason I decided to use WP-Optimize to optimize the website database, normally I used to do this manually even though I was already familiar with this plugin but I realized that having the convenience of doing it automatically is priceless.

For this reason I updated my guide by inserting a new point on WP-Optimize, below find a speed scan of my website before and after the cleanup, as you can see the mobile part has improved dramatically.

Analysis of the website before Wp-Optimize

Analysis of the website before Wp-Optimize

Analysis of the website after of Wp-Optimize

Analysis of the website after of Wp-Optimize

Share this article

Table of Contents

Follow my WhatsApp channel

Discover our products

Follow me on social media

Latest Posts

2 Comments

  1. Macesanu Madalin Florentin says:

    Great article, I shared it with my blog readers and some really liked it. For this reason, I decided to write an article as well where I talk about the 21 basic steps to follow that many people ignore to speed up WordPress. Let me know what you think even if you decide not to approve this comment.

    • Thank you for the wonderful feedback!

      It is important to explain how you can speed up your WordPress site as it is one of the key aspects of having a successful site.

Leave a Reply