Most of us know that since 2010, page speed is one of the ranking factors in Google. However, Google is putting more and more emphasis on this aspect by adding more factors, this time qualitative. You can read a little more about this in the article "Google plans to add page quality to ranking signals". What can you do to make your website on WordPress run fast? In this article, I will try to give you some tips on how to speed up your WordPress site.

Why should a website be fast?

There are many reasons why you should pay a lot of attention to your site's performance. A few of the most important ones:

  • I mentioned this in the introduction. Google considers page speed, which translates into positions in search results. So if you want to get noticed in the organic results, then page speed should be one of your priorities.
  • A faster website also means more engagement from those who come to it. Pages that take longer than 2-3 seconds to load usually have high rejection rates. This translates into interest in what you offer and consequently lower or higher conversion rates.
  • Unfortunately, the most impatient group are people who are looking for products or services they want to buy. They expect to receive information immediately. If this does not happen, it has a negative impact on purchase decisions. As a result, a slow website generates fewer sales.

How to check if my website is slow or fast?

To tell if a website is slow or fast you need to test it. You can't tell just by clicking around unless it's obviously taking a very long time to load, but again, you need to look at what's actually causing this so you know what you need to work on.

In general, page speed is affected by many different factors, for example:

  • Page size (its weight)
  • Number of queries it generates
  • Whether it uses caching mechanisms or not
  • Whether the page is static or dynamically generated
  • How it is structured

Tools for testing website speed and quality

In practice, even if you see that a website is slow, you won't be able to deduce much, and even if you try, your conclusions will probably be wrong. Beginners, seeing that their website works slowly at first sight think that it is a matter of the server on which it works, but in practice it is not a zero-sum problem. In such a situation, changing the hosting account to a higher plan with more computing resources, may not bring any results, or they will be negligible.

In order to accurately diagnose which elements of the website are failing, it is worth using tools that have been designed for this purpose. A few of them:

Pay attention not only to overall page load time, but also the factors described in the aforementioned article "Google plans to add page quality to ranking signals“.

Choose a good hosting service

An important factor in site speed is the hosting on which your WordPress site runs. In most cases, we opt for shared services, for a mundane reason. They're cheap. However, such services often don't provide good response and load times, and many don't provide 99% site availability time per month.

The truth is that shared hosting usually provides poorer performance because you share the same server space with many other sites, so you have limited resources at your disposal, especially computing resources. Don't suggest capacity, number of email accounts, databases, transfer levels etc... these are tertiary parameters.

Fortunately, the hosting industry has evolved thanks to modern technology and prices for cloud services have come down. Today, you can buy dedicated servers such as DigitalOcean, Linode, Amazon Web Services or our cloud servers at a decent price. However, setting up such services can be a tough nut to crack as you have to set it up from scratch and do it yourself or with the help of someone who knows how to do it. There are service providers such as Cloudways where these processes are simplified but nevertheless, these are services that require more commitment from you or more administrative costs than shared hosting.

If you have the budget for such hosting invest in it, if not choose hosting that will give WordPress as much 'space' as possible to operate. Check out WordPress hosting with many built-in mechanisms that will not only make your work with WordPress easier and more secure, but also more efficient.

Use PHP 7 or higher version

Check your hosting to see what version of PHP you have available. PHP is an open source server-side programming language that is used by developers primarily to create websites and web applications. Most of the core WordPress software is written in PHP, along with plugins and themes, making PHP a very important language for the WordPress community. Your hosting should have at least PHP version 7.x. The recommendation is a minimum of PHP version 7.3, as it offers significant performance improvements over previous versions. At WordPress hosting you have PHP 7.4 or even 8.0 available, although with 8.0 coming in early 2021 still be careful as many plugins and themes are not fully compatible with this version of PHP.

Use a good theme

This is one of the most difficult tasks. Usually, when choosing a theme, we are guided by what we can see on its demo versions. We look at how the theme looks, whether we like it or not and this determines our choice. I tell my students all the time not to be guided by the look. You can always change the look. If the theme is good it will give you a wide range of possibilities to customize it. Be guided by the quality of the theme and its real capabilities, not by the attractiveness of the demo pages!

The themes I recommend can be found in the article "3 Best Free WordPress Templates". Each of the mentioned is a theme developed by experienced developers, well optimized, fast and flexible. Even if you don't find something you like among the import homepages, as I mentioned before you can create something of your own to suit your needs.

Choose your plugs wisely

A bit like with themes. Lots of choice so hooray 🙂 The point is that by installing more plugins your WordPress gets a number of more tasks to do. The more of them there are, the harder it gets. Remember that plugins, just like themes, are written by developers with different levels of experience. So there will be plugins that are perfectly optimized and have minimal impact on performance, and there will be others that have a huge impact on the site's vitality.

The principle of the less the better applies here. Strive for minimalism, focusing on the content you want to convey and your business goals. A website with lots of gadgets will not sell more, quite the opposite. Most people who come to your website are looking for information, products and services, not water features. So give those people exactly what they are looking for without any "embellishments" and you will achieve your goal faster.

Get rid of unnecessary plug-ins

You could say. This doesn't apply to me as I need all the plugins I have. But are you sure? As with the above point, aim for minimalism. In most cases (I'm not saying it's the case with yours), the website has plugins installed which it could easily do without.

Use caching mechanisms

Many site administrators, and not just on WordPressi, completely forget about this important factor with regard to performance.

What is caching/buffering all about? When we send a query to the server via a web browser, for example asking it to display page X, the web server has to do a lot of work before it sends data to our browser. It compiles PHP code, performs a lot of operations, calculations and queries e.g. to database and only after these actions the result is passed to us. We can see the page.

When we use cache mechanisms we can significantly reduce the amount of work on the server side because once performed operation can be stored in the cache memory for a specified period of time. When the server receives an identical request during this time, it does not repeat all the operations but returns the result from memory. This is, in a nutshell, the benefits of caching mechanisms for the website and indirectly for its users and you as its owner.

WordPress as a standard does not offer this type of mechanisms so it is necessary to use plugins that will help in this task. I personally like and use in most of my projects the plugin WP Rocket. Unfortunately, this plugin is only available as a paid version. If you don't want to invest in it, you can look around for free alternatives such as WP Fastest Cache, WP Super Cache and W3 Total Cache etc. There are quite a few of them.

A very good tool that takes care of everything, including graphic and CDN optimisation, is NitroPack. It's not a free tool, but it's worth looking into. It can optimize the performance and quality scores of a site in 5 minutes in a surprisingly good way. My clients and JZS readers can activate NitroPack with 5% discount. Just use the code POZNAJWP when ordering the service or purchase by clicking the button below:

Store page files in web browser memory

This is another element affecting the speed of page loading in the user's browser and reducing the number of queries to the web server, and thus the load. Cache on the side of a web browser consists in the fact that it remembers the once opened page and its components, e.g. CSS, JS, graphic files, etc. These data are saved on the disk of the person visiting the page, thanks to which the next calling of the same element, e.g. an image, will not cause sending a query to the server, but its loading from the browser's cache.

If you use the plug-in WP Rocket, W3 Total Cache, LiteSpeed Cache or WP Fastest Cache, You can easily activate this option in the plugin settings, so that appropriate headers with information about how long a particular type of file is to be stored are sent to your browser. If you do not use a plug-in which offers this option, you can, for example, place in the file .htaccess sample rules:

.
ExpiresActive On
ExpiresDefault "access plus 14 days"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/gif "access plus 14 days"
ExpiresByType image/png "access plus 14 days"
ExpiresByType image/jpg "access plus 14 days"
ExpiresByType image/jpeg "access plus 14 days"
ExpiresByType text/css "access plus 14 days"
ExpiresByType application/javascript "access plus 14 days"
.

It is worth using this mechanism.

Enable gzip compression

Compression means that the server sends compressed, i.e. much smaller, files to the browser, which decompresses them. This makes the data transfer faster, which by the way reduces the consumption of data transfer on your account. In case of W3 Total Cache, Litepeed Cache or WP Fastest Cache plugins we have the possibility to enable gzip compression for text files, however if we do not use a plugin with such functionality, we can enable this option on our hosting account. It is also often the case that compression is already enabled by default.

Optimise images

If you upload photos directly from your phone or camera they are not optimised in any way. This means that they will be much heavier and will take longer to load. Every graphic you place on your website, whether it is a design element or an illustration inside an article, should be properly optimised.

The subject can be approached in several ways:

  • Optimisation before uploading - you slim down the image by using the appropriate format and compression in a graphics program that gives you this capability.
  • Optimisation with plug-ins - You install the appropriate plug-in, e.g. Smush, Short Pixel or similar and it does the optimisation for you.
  • Optimisation on the side CDN services - Some CDN providers such as BunnyCDN offer an image optimisation service.

Enable lazy load of images

If you have a lot of images on your site consider lazy loading. This is an optimisation technique that loads the visible content of the page, but delays the download and rendering of content on the non-visible part of the page. Images will only load when you scroll the page to where you want the image to appear (appear in screen view).

Optimise CSS / JS files

If you analyse the quality and speed of your site using the tools I mentioned earlier, you will probably receive a notification that you should reduce the size of your CSS/JS files and their number. If you do this your quality and speed results will certainly improve.

In addition, if you are familiar with WordPress themes, you can refer to the guides provided by Google and make manual adjustments. however, if you are not a developer, further plugins such as Autoptimizewhich can help you optimize the CSS, JS, and also the HTML of your WordPress site. Many of the caching plugins I mentioned earlier also have such capabilities. So before you reach for installing more add-ons, check first what the caching plugin you are using offers in this area.

Take advantage of the CDN network

How it works. A CDN is usually a number of servers scattered around the world that store your website's files. This includes static files such as CSS files, JS files and the like, and even videos. What for? Let's assume that the server your website is hosted on is located in Poland. People visiting from Poland have good response times and the page loads quickly. However, if your website is visited by someone from distant parts of our globe, e.g. someone from the USA, Australia... then the distance will do its job. Of course it won't happen that a page will load in 2 seconds for someone in Poland and in 20 seconds for someone from the USA.

If you use a CDN, the static files for the page will load from the location closest to the person who views the page. So if the visitor is someone from the USA they will get the files from a server in the USA, if it is someone from Australia they will get the files served from a data centre in Australia etc. This way your website will be fast no matter what geographical location it is launched from.

Personally, I most often use BunnyCDN because of its value for money. I recommend you take a look at this network.

Take care of database hygiene

WordPress works on the basis of a database. It accumulates a lot of various information both related to configuration, but also activity. Removing unwanted data will reduce its size and make it efficient. Remove spam comments, fake users, old drafts of content, or excess versioning.

Limitation of the number of versions of page content

As for the number of versions to be stored in the database for each text, you can limit their number by adding one line to the wp-config.php file:

define('WP_POST_REVISIONS', 5);

The example above will limit the number of stored page versions/entries to 5. By default, there is no such limit, so the database can grow and grow indefinitely. What's with the versions? If you make modifications e.g. to an article on a blog, WordPress, after saving changes, keeps its previous version in the database so that you can return to it if necessary. Each change in the article generates another version stored in the database. I'm sure you don't need too many of these. You can also turn them off completely.

Total deactivation of the storage of older versions of website content

If in your case you don't see the need to store older versions of articles/pages or other types of content in the WordPress database, you can completely disable this mechanism. To do this, add the following line to the wp-config.php file:

define('WP_POST_REVISIONS', false);

Minimise the number of external scripts

The use of external scripts tends to hit the basic metrics of site speed and quality hard, and this is true even if you use Google tools such as Google Analytics or others as external scripts. The same applies to all sorts of pixels, tracking codes, widgets displaying e.g. current exchange rates, Instargam photos, reviews etc. etc.

Do a simple test. Prepare your website without any external add-ons. Check its quality and speed results. Then insert any video from YouTube, if only using Gutenberg block. Publish and compare data.

In the case of GA or Facebook pixel, you can use plugins to store these scripts locally and thus eliminate the problem. However, you'll have to deal with all the others yourself or simply consider dropping them if they're not an important part of your performance strategy.

Off pingback and trackback

Pingbacks and trackbacks are two WordPress components that notify you whenever your blog or site acquires a link from another blog. This may seem useful, but in practice tools such as Google Search Console and other services to control inbound links with a much greater range of analytical capabilities.

Enabled pingbacks and trackbacks can cause unwanted strain on your server resources. These features are also commonly abused when DDoS attacks are directed at your site.

You can disable this in your admin panel by going to Settings → Discussion and unchecking the option to allow notifications for links from other blogs (pingbacks and trackbacks). This will help you speed up your WordPress site even more.

Test new plugins or a new theme on a clone of your site

It's definitely worth doing. If you're installing new plugins and seeing what they can do on a production site, on the one hand you run the risk of something stopping working when there's traffic on the site, but more importantly you may find something that has negative consequences in the future.

When you test a plug-in, you first install it, then check what it can do, how it works with the set of plug-ins you already have, how your theme handles it. If it turns out that a plug-in doesn't meet your expectations, or if it conflicts with another component of your site, you uninstall it and look for another one. The whole thing seems innocuous, but...

One of the biggest problems with WordPress plugins is the process of uninstalling them. Every time you install a plugin or theme, WordPress stores data in a database. The trouble is that when you remove a plugin using one of the standard methods, it usually leaves the tables and its records in the database. Over time, this can add a lot of completely unnecessary data and even slow down your site.

Therefore, test plugins or subsequent themes on a clone of your site, not on the production version. If you see that everything is OK on the clone and you've found a plugin or theme that you actually want to use, only then install it on the production version. You can create a clone of your site with a single click on a WordPress hosting accountThis will not take up much of your time and will make your website more efficient.

Why plug-ins leave a trail

You may wonder why when you install and then remove a plugin it leaves behind records in the database. Most often when you remove a plugin you probably assume that since you removed it, it's gone. This is not quite the case. Whether a plugin deletes its data in the process of being deleted depends primarily on its creator. If that's the case, why doesn't the author implement this capability? A couple of reasons:

  • The author wants to make your life easier by keeping the plug-in settings. If you decide to reinstall some time after deleting it, all previously entered configurations are retained. This is obviously convenient, but from a WordPress optimisation point of view it is not particularly effective.
  • The author does not care about performance optimisation. Unfortunately, this is a very common phenomenon, and some programmers believe that leaving the configuration in the database does not affect the performance of the site. However, imagine a situation in which your website is already a few years old and during that time you have installed hundreds of various plug-ins, which have added new tables and thousands of records to your database. Sooner or later it will start to affect the performance.
    Let me give you a simple example. JZS has been running since 2009 so the site is already a dozen years old. At the end of 2020 I decided to do some thorough cleaning. Before the actions the site database weighed nearly 1 GB, and after the cleanup its size did not exceed 40 MB. I should add that I did not remove any article or subpage published on JZS. The conclusion? About 95% of the WordPress database was data from old plugins I had installed over the years.
  • The author made a mistake. To err is human. We all make mistakes, programmers do too. Traces left by a plugin even if it has an option to remove them in the uninstall process may be due to an unintentional mistake by the developer.

Change the number of blog posts / products on archive pages

If you run a blog, for example, you don't need to serve a large number of posts to site visitors right away. The fewer requests and loaded media on a page, the better. So change the number of entries displayed on a single page if their number is large. My suggestion: oscillate around 10.

Take care of Cron job optimisation

WP-CRON tasks are used to schedule and run repetitive tasks on a WordPress site. However, over time they can get out of control and cause performance issues. You can use the free plugin WP Crontrolto check all Cron jobs running on your site.

Performance issues related to WP-CRON are also common. If a site doesn't have enough PHP processes running simultaneously, sometimes tasks have to wait in succession for processes to slow down. At some point this can have a negative impact on site performance. So what I suggest is to disable WP-CRON and use system cron instead. This practice is even suggested in the official plugin documentation.

How to disable the built-in WordPress cron?

Just add the following line of code to your wp-config.php file:

define('DISABLE_WP_CRON', true);

After saving the changes, WP-CRON will stop executing tasks, but you can't stop there, because tasks must be executed for your website to work properly. In the next step, you need to configure a system cron task on your hosting account, which will be executed, for example, once every half hour.

Using WordPress hosting accounts You can configure the whole thing with one simple click. Just let the hosting service take over the cron jobs and you don't have to do anything else.

Taking over WordPress tasks by a hosting account

An entry will automatically be added to the configuration file and a system cron job created.

Memory limit

If you know what the memory limit is in the PHP configuration, then you know that it defines the maximum amount of memory that PHP can use while processing your page.

You can look at the limits available on your hosting account and you will see that you have them at 128MB or 256MB (if your hosting offers less and you do not have the possibility to increase this parameter look for another provider). So it's ok, but it turns out that in some situations WordPress generates errors and you see that it lacks memory to perform one or another operation. Why?

By default, WordPress will try to increase the memory for PHP to 40MB for a single site and 64MB for a multisite installation. So where does that 256MB go? The memory usage by WordPress and the memory set in the PHP configuration on the server are effectively two different things. Therefore, if you encounter a memory-related error you can try increasing the memory limit in WordPress.

To do this, add the following line to your wp-config.php file:

define( 'WP_MEMORY_LIMIT', '256M' );

Summary

A lot of it, right? And that's not all, because we could use additional mechanisms such as Redis or Memcached to store object-oriented SQL queries in memory, which reduces the number of queries to the database and consequently has a positive impact on performance.

One by one, apply these configurations and see what effect they have on your site. In the case of WordPress, the most visible effects come from using good caching mechanisms, but the others also contribute to improved results.

Share

See also

The best cache plug-in

The best Cache plugin for WordPress

You've probably had, or will have, more than once a situation where your website can't boast good quality and performance results. Everyone without exception

WordPress login

WordPress login - How to log into the panel

Logging into the administration panel of a website running on WordPress is an activity that does not require complex knowledge. All you need is a basic knowledge of this CMS or a hosting account for

Free information on JZS news

I invite you to become a subscriber! Thousands of readers already subscribe to news from JZS.

You can unsubscribe at any time. Your address is safe here.

Featured LifeTime Offers!

Gravitec
Gravitec

Use WebPush notifications to increase traffic and sales

pcloud lifetime
pCloud

Cloud drive with lifetime access. Save your files and...

Now4real

Build community and increase engagement on your site using Now4real.

6 Comments

  1. Radosław says:

    I have another problem, and I don't know if it is the fault of the WP Fastest cache plugin. I used to analyse the page load speed and to this day the search engine shows these results. Just in case, I disabled the plugin and will see. On the other hand, the plugin mentioned above is also sometimes problematic.

    1. Rados豉w I removed from your comment the address of the page you used to test, because it does not exist. In general, I suggest testing with tools such as GTMetrix, WebPageTest, Google Page Speed, and additionally Lighthous in the Chrome browser's developer tools.

      Remember, however, that all of these tools perform lab tests, which will not necessarily reflect real page speed. Google Page Speed should, after some time, show general performance data that is based on information collected from users of the Chrome browser. It's this data that, from June 2021, Google will add to the list of factors affecting search rankings. This won't be lab data!
      You may find that metrics values from real users will be better or worse. Therefore, when working on technical SEO optimization related to WordPress site speed, you cannot ignore information about what hardware your visitors are using.
      A simple example: most of those who come to the site are using old smartphones, which are not particularly powerful. The effect will be that the results of Web Vitals will not necessarily be good, even if they are OK in laboratory tests. Another case. Most users of your website have fast hardware, the page renders instantly. The effect will be better results on Web Vitals indicators and they may be more favorable than laboratory ones.
      This knowledge should be reflected in the design of the site, especially if a large number of visitors have older, slower equipment. In such a situation you should build your website so that it loads quickly on such devices, so you give up all the gadgets and "enhancements" to make the code as light as possible. This will make the page render faster on weaker devices, which will improve its real quality/performance results.

      As for the WP Fastest Cache plugin, it's a very simple but also effective plugin. I honestly never had any problems with it where I implemented it. If it doesn't work in your case, then use another one. There's some of it 🙂 .

  2. Szymon Samuel says:

    Interesting tips, thanks 🙂

  3. W3total Cache for Wordpress is for me definitely better than Total Cache, but you have to be careful with configuration. The plugin provides a test environment before enabling a given modification permanently, which completely secures the changes.

  4. I recommend Plugin Organizer plugin - it allows you to decide which plugins should work and which can be disabled on a subpage which results in not uploading unnecessary .css .jscript files. Many plugins, as you noticed, can slow down WP and make it a mule, this plugin allows us to enjoy fast WP and plugins. It's like eating cake and having cake:)

  5. Extensively described the issue of caching, but you devoted little to the topic of plugins themselves and optimization of the code itself. It's worth testing the speed and impact of plugins on site performance. You can use solutions that also compress HTML code (remove unnecessary comments, spaces, etc.). Storing graphics in the browser's memory is 99% necessary, but it is worth (with a view to new users or those who often clear cookies or use incognito mode) also compressing the images themselves. This is one of the main suggestions offered by PageSpeed Insights from Google when I audit sites. Take a look at the text linked under my name (I won't duplicate the link so as not to clutter you up too much) - I think you'll find some interesting tips. And maybe you will add your 3 cents in the comment 🙂 Regards

Leave a Reply

Your email address will not be published. Required fields are marked *