How to Speed up Your WordPress Site (Ultimate 2020 Guide)

WordPress Optimization

How to Speed up Your WordPress Site (Ultimate 2020 Guide)

matthew-woodwardDid you know that a one second delay in website speed decreases conversions by 7%?

But what does that actually mean?

According to Google, if I increased my website speed by 1 second…

…I would make an extra $28,464 per year!

Matthew Woodward
matthewwoodward.co.uk

From 2000 to 2016 the company Loadstorm conducted various studies, the results of which were summarized in this infographic. Each additional second that is spent on the download page:

  • Leads to 7% loss in conversions,
  • The site will be viewed on 11% of pages less
  • The visitor will be satisfied 16% less.

25% of visitors will leave a website if it is loaded more than 4 seconds.
74% mobile visitors will close the page if it will load for more than 5 seconds.
46% of visitors will not return to a slow website.

Why is the download speed of the website

Fast-loading pages improve behavioral characteristics, increase the number of pages viewed, and help with SEO.

In this article you will learn all the basic ways of speeding up and optimizing WordPress.

In the first part you’ll learn what optimization is and what elements it consists of. In the second part — where and what changes you can make to speed up the website.

The Internet speed is different in different places, it depends on the distance between the visitor and the server and connection speed. Even if you use a CDN, and optimizing everything that is possible, in some places your website can be opened for a long time.

Go through this guide, maybe it will speed up your website by 0.5 seconds in US and 1 — 2 seconds slower from areas where it can be your audience. This will increase the efficiency of the website.

Acceleration also leads to higher in search results, that is, the higher the speed — higher position in the search results.

Fast web sites usually spend less CPU time, less access a database that are smaller media files.

Why the site loads slowly

3 reasons why a website is slow:

  1. The site is on a cheap (slow) hosting
  2. The website is slow because of bad code
  3. Great pictures on the website.

1. The technology that runs the website

Depending on the technology and language of the written website code on the server will be processed faster or slower. Static websites written in HTML, are very fast, but now most sites are dynamic, that is, use the code to automatically write other code on the server side.

There are several technologies that are used for writing dynamic websites. Now the most common technology PHP.

Dynamic websites are slower because they require more time to generate the pages compared to static websites serve visitors already ready html pages.

2. CMS. The content management system

Any CMS works in principle slower than well-written static html website. There are caching pluginsthat are almost completely reduce this difference, but they periodically shed or updates the cache, authenticated users usually get necessitavano version of the site, and management of cached content takes up more server resources.

In the end the difference is small, but well-written CMS gives a great advantage over html website usability site content. WordPress is written very well.

The reason why CMS are slower than html sites, is in the process of creating the final html page: the user requests some page, CMS accesses the server, the server processes the request, generates html code and sends it to the user. CMS makes several dozen requests to the server, and this increases the time of generating the final html page.

Most CMS have the tools to optimize those queries, so CMS successfully compete with static html sites.

3. Themes and plugins

Themes and plugins do not write the same developers who write WordPress. This means that if the developers of themes and plugins don’t follow the updates that the developers are adopting WordPress these themes and plugins may have errors that will slow down the website.

For example, after the update to perform some operations has been used not a few inquiries, and one (or Vice versa). In this case, this approach speeds up the entire operation.

At WordPress there are many plugins to add new features. Use the ones that are regularly updated, have positive reviews and have 1,000 or 10,000 units better. Ideally, the plugins on the site should be as small as possible. For example, search engines one of the factors of ranking websites — the ratio of code to content. A good ratio is something like 30/70.

4. The server and hosting

The server makes a major contribution to the acceleration or deceleration of the website, especially at the peak load.

The server is a physical computer that has a processor, RAM, hard disk and other components that determine its performance.

Hosting is a set of settings for this server. CPU time, automatic backup, and so on.

For simplicity, the most significant parameter of hosting type hosting: shared hosting, VPS hosting or dedicated server.

  • On virtual hosting can be from a few to a few dozen sites, this means that they all use the same disk as your website, the same RAM, same CPU, same Internet channel. At the same time resources are distributed unevenly, that is, if a site started to slow down and began to use 80% resources of the server, all other sites will be only 20% of server resources.
  • VPS (Virtual Private Server)Virtual private server is a virtual hosting, but the server resources are distributed evenly among the sites on this server. If such hosting are 5 sites, each of them will receive 20% of server resources. If one of these sites started to slow down and needs more than 20% of the resources, then he can’t have them because the resources are rigidly divided between sites.
  • On a dedicated server, one site (or one account) is the only consumer of server resources.

What hosting to choose?

Do not use virtual hosting, or use something not too important to you for example a personal blog or technical website, because the sites on this hosting can let you down.

Do not take a dedicated server. If you don’t know whether you need a dedicated server, it is likely that you do not need. It’s hosting for those who understand server technology, or for sites with high traffic.

There are 2 options:

VPS hosting is a good option between these two. They are more expensive and less expensive. If you have low attendance, choose a cheaper VPS hosting if you have a high attendance — choose more expensive. The difference in price depends on server resources, higher processor frequency, number of cores, and so on.

On some hostings it is possible to pay for resources, that is, if you need more resources because of the increased attendance, you can buy more server resources without changing the rate. For Example, Beget.

Another option is WordPress hosting. It is community of fans of WordPress with its own atmosphere. There is a free fare, which you can get a subdomain type my-domain.wordpress.com on it you can only install free themes from the proposed and other restrictions. The following fares are$ 4 a month, then$ 8 per month and so on, the options constantly increase. On this hosting servers are configured under WordPress, you cannot install anything other than WordPress, and WordPress itself is a little peculiar.

Server settings

The servers may be a different number of resources may be faster processors, faster RAM, and so on. The more resources, the faster your website.

If you have a small website with attendance of up to several thousand per month, you will not notice the difference between 1Gb and 8 Gb RAM.

Another important parameter server is remote from the visitor, the farther away you get from the server (or fast Internet), the slower the website. In developed areas, data is moved at the speed of light in fiber optic channels, but at the approach to the end-user to the Internet is slowing to a local provider. Also the velocity is affected by routers, firewalls, and other equipment that runs the page towards the visitor.

When the page is loaded, it creates a variety of requests — images, stylesheets, javascript and others. Fewer requests, the faster the website.

The visitor’s computer

From the user’s computer is also depends on how quickly it loaded the website. Older computers are slower, but now it doesn’t matter much, because most calculations are done server-side, but with the development of new technologies, websites are starting to use more calculations on the client side.

For example, faster and more smooth animation, but it also means that the sites on slower computers will run slower.

Website speed depends on used technologies, on which is written the website, from CMS, from servers and hosting, and from the user’s device.

How to increase website speed

1. Update PHP and MySQL

Upgrade software version from time to time. More expensive hosting services constantly updated, but some cheap hosting providers may long to update the software, or update when you ask.

PHP versions differ in the processing time code especially PHP 7.

How to upgrade the PHP version depends on your hosting. Go to the hosting, try to find something similar to the PHP Configuration, or it can be in Sites. This is usually a drop-down list or the checkbox next to the desired version.

Verify that the version of PHP below 5.6, WordPress recommends to use version 7.3.

Before you decide to upgrade the version of PHP, will talk to the tech support, you may need to go back to the previous version, make sure that you will be able to do it.

Verify that the version of MySQL is below 5.6.

Select the size of PHP memory is 128MB or above.

2. Update WordPress

The first security requirement of the website — regular updates to WordPress, themes and plugins. Although updating WordPress accelerates website in some visible way, but in updates, the developers often optimize the code, the site becomes more effective the queries are handled faster, resulting in some increase in speed.

In addition, the developers release updates to address vulnerabilities that increase the security of the website.

Update WordPress, themes and plugins.

3. Reduce the number of queries to the database

You can see how many queries a page makes to the server in your browser developer tools, or on services such as Pingdom.

When you add a picture to the page adds a new query to the database. One request for one image.

If you have multiple images on the page, and some of them are used on archive pages, this page can create 60-70 queries.

One of the easiest ways to reduce the number of requests — do not use Google fonts, disable Font Awesome and Gravatar. Will see what you need, maybe you can disable.

Another easy way — reduce the number of posts per page in Settings — Reading, or try to post less pictures.

Reduce the number of plugins on the website, it will increase the website speed for visitors. Many plugins add their scripts, styles, etc. Disable one plugin, this will reduce the number of queries to the database 1-2. Or 3-4 if the plugin is not written very well.

Changing the topic can reduce the number of queries, but in many cases the difference is not very noticeable. Large Premium themes that contain many features frequently download a large number of unused scripts and styles.

Perhaps a lighter theme will add speed to you.

These topics are well known in the WordPress community and are often recommended:

  • Astra — easy theme with a huge number of settings, plugins, additional plugins and extensions for WooCommerce, Elementor, LifterLMS, and some others.
  • GeneratePress is a popular easy theme from Tom Osborne.
  • Genesis is a popular framework for creating themes.
  • StudioPress themes based on Genesis framework.
  • OceanWP — easy theme with many options both free and paid plugins to extend the functionality.

Lazy loading is a powerful tool that can accelerate your website. Lazy loading does not reduce the number of queries, but defers loading of images until, while they will not appear in the browser window, during this time, the main part of the page has time to load.

4. Remove unnecessary and hindering plugins

It is believed that there is some correlation between number of plugins and site speed.

In fact, not all, but many plugins affect website speed, so the basic idea is close to the truth.

Many plugins not only increase the amount of website requests, but can cause other problems, for example, security issues or excessive memory consumption.

Instead of simply to remove as much of the plugins, try to remove or replace those that do slow down your website.

If your site runs on PHP7 and above, use a tool called a Waterfall on services such as GTmetrix or Pingdom.

WordPress-Optimization.jpg

Start the service and view the queries that slow the website. Click on the required query, the tooltip will show what plugin is source of this request:

Another good free plugin that may not seem very simple — the Query Monitor plugin.

Also disable the plugins you don’t use often, for example, Thumbnail Regenerator, Duplicate Post or P3. This is a very useful plug-ins, but if you use them infrequently, you can disable them so they do not create unnecessary queries.

Another good way to reduce the number of queries is to use a single plugin that has many functions, for example, Elementor Pro who makes sliders, various forms, social buttons, countdown timers, a site map and much more.

5. Optimize database

Over time, the database of the site will be large, it is inevitable. The size of the database consists of two components: the unused data and service data database.

Unused data appear from different places, for example, deleted plugins and themes can leave your settings. Deleted posts can leave their metadata, connection between remote pages, deleted comments, and so on.

Over time, the database accumulated hundreds, if not thousands of records that are not attached to anything. This is especially noticeable on large sites or sites with a large attendance.

For overhead , you can use built-in MySQL tool that can analyze, optimize and repair the database.

This work can do plugins. WP Sweep (free) clean database from unused and overhead, and optimizes the database. Plus this plugin is that for optimization, it uses the standard functions of WordPress. The downside is that it doesn’t have a schedule for automatic service.

WP Optimize (free) — does the same thing, but it has an automatic schedule. To optimize the database it uses direct database queries, which may leave behind some debris. Settings low, suitable for beginners.

Advanced Database Cleaner (free) is similar to the previous one, but there is a cool editing tool databases manually edit a cron schedule and edit the grid options in the database. Plus the fact that has everything you need, minus some that are used for optimization of direct database queries. Suitable for advanced users.

These plug-ins, as well as others like still leave some debris that can be cleaned manually. In order to clear manually, you need to know what corresponds to each record in the database.

Advanced Database Cleaner Pro (paid) shows, which represents each record in the database.

6. Optimize images

Studies show that pages that include images, like users 80% more than pages without pictures. But the pictures you want to optimize, i.e. reduce their size in Pixels and Kilobytes. Unoptimized images are one of the main reasons for the slow speed of the website.

For example, if you want to insert a picture, which will occupy 1/3 of the screen, make it the appropriate size, for example, 400х250 pixels. Modern requirements Google and other services on this size is something around 20-30 KB.

In Photoshop or Illustrator you can save the image with the function “Save for Web” in jpeg or png file. These are the two most common image formats.

JPEG format which uses lossy compression (lossy) and does not support transparency. Images of this format can be significantly compressed without a significant loss of image quality.

PNG — lossless compression (lossless) and supports transparency.

  • If you need a good color picture (a photo), use jpeg.
    You can reduce the picture quality to 20-50, lower quality for the background or shaded images, higher quality for the images in the mind.
  • If you need a simple picture, icon, chart, transparency, use png.
    To optimize you can change the number of colors of the picture. For more complex with a lot of colors use 128-256 colors for more simple images with few colors can be reduced to 32-64 colors.

You can optimize images in Photoshop or Illustrator, or can goodtimesroll their website with different plugins.

For example, ShortPixel (complimentary), WP Smush (free), Tiny PNG (complimentary), EWWW Image Optimizer (free). ShortPixel offers free optimize 100 images per month, WP Smush optimize image directly on the site, but optimizes half, the second half is paid, you have to buy a Pro plugin. Tiny optimizes PNG images on your server, the free version up to 500 images per month.

Good feedback from the plugin Imsanity and Imagify (free 25 MB per month). Can also try online services Optimizilla and Bulkresizephotos.

7. Remove all the unnecessary glitter

Different decorations, design elements, mostly written in js, can look good but are not much use, for example:

Annoying elements. Suppose you have some fold-out menu with a nice animation when you hover on it with the mouse. When a visitor first time to see this menu, it he likes. But the third time it will annoy the visitor does not want to wait a second until the menu opens.

Remove unnecessary decoration, it will add to the website speed. If the site will have less animated elements, Java less, less styles, it will speed up its work.

The second example relates to the conversion of ornaments into sales. A good example is the slider. Almost every study on the topic of sliders comes to the same conclusion: in 4 of 5 cases the slider is better not to use. It takes a lot of space, it lowers the SEO, it slows down the website.

The meaning of the site is not to look attractive. To look attractive is a tool that is used in order to achieve the main goal — to make money. You might remove the slider and get more sales.

Instead of slider you can write some text with a link or picture.

8. Use a CDN

CDN is a magic website, which makes the site much easier and faster. CDN does two things: it allows you to store images not on your server, and it reduces the load time of pages.

The essence of a CDN (Content Delivery Network — a Content Delivery Network) to serve the visitor the content from the geographically closest server. For example, this website is located in Miami, but if a visitor is in Paris, he will receive the content from the closest CDN server, which is located in Paris. Another visitor may be, for example, in London, he will receive the same content from the server in London.

When the images are on a CDN, it frees the content from the media files. You can change the domain or move to another hosting, but your media files are always stored in one place. Database and website usually takes 40-50 MB, but the images can occupy several Gigabytes for a large website. If they are on a CDN, you can move 40-50 MB is not a problem.

This reduces the number of nodes through which the content accelerates the delivery time of the pictures, and ultimately speeds up the page loading.

9. Turn on caching

Caching is the most effective way to speed up the site. Example of caching: you know how much is 5×5. Once you have folded 5 times for 5, were convinced that the answer is 25, since you just know that the answer is 25 and not check it every time. Caching of the site works on the same principle:

WordPress-Optimization-2.jpg

The first visitor accesses the website with a request to some page, CMS forwards the request to the server, which queries the database and php files to give the desired information, generates an html page and sends it to the visitor.

The next visitor to the page will get ready cached html page that was saved by the plug-in cache after the first request or on a schedule plugin.

A simple but powerful caching plugins: WP Super Cache and WP Fastest Cache.

W3 Total Cache is a powerful plugin that has all the tools for caching, minification and optimization.

10. Enable GZIP compression

GZIP is an effective way to speed up the site, which reduces the page size to 70%. To enable this function on the server entry .htaccess, but many of the cache plugins have this feature. To check whether you have enabled GZIP on the site checkgzipcompression.com.

The principle of operation of GZIP is that HTML and CSS use a lot of repetitive fragments. The more repetitive pieces, the stronger the page can be compressed. For example, if the page 20 times it says “Optimizing WordPress”, then this entry can be replaced by “20ОВ”, or something like that. The more and the longer the repeating patterns are, the more space can be freed.

GZIP is included in many caching plugins, or you can do it manually:

11. Move scripts to footer

If you can move some script in the footer, then carefully transfer. Call the jQuery library takes place in the <head> section. If you move the connecting jQuery to the basement, the scripts which are rigidly fixed in the header and cannot be moved to the footer, drop out with an error because jQuery is loaded only in the footer.

This will increase the apparent speed of the website. It will not reduce the number of requests or the size of the files, but the essence of this practice is that the main site content loaded before secondary content that these scripts represent. If a script zaglyuchit, the main part of the site still loads.

This can be done with plugins W3TC (manual), Hummingbird, Clearfy and others.

12. Minehillite and merge files

After you got rid of everything unnecessary, and made the necessary changes, the code can be minifirewall to reduce the size of the files. The browser doesn’t need comments in the code, spaces, line breaks, and other things which are necessary for the site developer. The browser can do with code written in one line without spaces.

After minification of files you can merge them. That is, instead of downloading 10 files, 20 KB, you can upload a single file of size 200 KB, which will download much faster.

This site is running on the processor W3TC, which does all the work on speeding up the site, but there are special plugins only for minification and merging of files: MinQueue, Merge + Minify + Refresh, Autoptimize or Dependency + Minification. They well merge files, but are highly dependent on server configuration and site.

In some cases, one plugin works better in the other two. Try one, see where the result would be better in your case.

If after combining files, you have a problem, they are usually causes merging JS files. Try to disable the optimize JS, most likely this will solve the problem.

13. Optimization technical SEO

When you publish an article on the website, it has some address. But the same article is duplicated in the files of the date, Categories, author Page, and so on. As a result, they will go to the search and will be indexed as different pages. That is, the weight of a page is distributed over multiple the same pages takes, who will compete for a higher position in the search results.

From these pages you can put a redirect to the main page using the plugin Clearfy that removes five types of duplicate pages, remove technical page, disables the Emoji, removes the WP version, scripts and styles and other information.

In addition, limits the number of audit posts, remove external links in comments, creates a file robots.txt makes the transliteration of the titles, redirect to https and so on, in version 3.3.2 more than 50 functions.

14. Disable hotlink links from your website

When another site uses pictures that are stored on your server, this is called hotlink. That is, another site uses the resources of your server, not your.

This does not speed up your website directly, but it reduces the load on your server. This will free up more server resources for the site.

15. Limit the number of audit posts

Audit posts take place in the database. Some experts believe that the number of revisions can affect some of the database queries that create some plugins.

To limit the number of audit posts can be inserting this code into the file wp-config.php

You can also do this with a plugin, Clearfy from Chapter 13.

16. Follow the site

Check your website speed from time to time.

I use these services:

Google PageSpeed Insights — https://developers.google.com/speed/pagespeed/insights/
Pingdom Website Speed Test — https://tools.pingdom.com/
GTmetrix — https://gtmetrix.com/

Conclusion: the Speed of the site is not the most important.

Although website speed is very important, but it is not the most important. You could disable all images and almost never use the styles or js, and achieve download speeds 350мс. But if you can help it to achieve the goal you are pursuing, or you just win a meaningless race for speed?

If your goal is a commercially successful website, you need to make every effort to achieve this goal, and website speed is one of the tools to achieve this goal.

Make a website with good content, friendly interface and attractive enough, this will be enough.
Check sites like Amazon or eBay on Google PageSpeed. You will see that their performance is far from ideal, but they do a good job for their owners, isn’t it?
I worked at one company their website is scored 50 points in the test Google, but was always on the first page of search results Yandex through content and advertising.