Blog » Development » How to Speed Up a WordPress Site: Proven WP Optimization Guidelines
Вордпресс разработка сайта

How to Speed Up a WordPress Site: Proven WP Optimization Guidelines

It is now impossible to imagine our life without technology. With their help, we spend less time on our daily activities. And this race is only gaining momentum every year. More powerful PCs and smartphones, high-speed internet and instant access to information - all this makes us selective and demanding of the web-sources that we use every day. If earlier everyone waited for the page to load for 5 or more seconds and did not complain, now few people are waiting and the 2.5 seconds recommended by Google. If the page does not show "signs of life" within the first second of user interaction with it, he will simply leave the web resource and go to competitors.

Alas, there is no getting away from this, and webmasters need to adapt to the realities of life, developing online resources of appropriate quality. And in our new article, we are going to show you how to speed up your WordPress site. Why did you choose this particular CMS for the review, you may ask. Everything is simple here. Firstly, our digital agency is engaged in WordPress development, and secondly, more than 65% of all world web resources made on CMS use this engine. And for which year WP has been in the TOP-1 in the ratings of the popularity of content management systems.

Bloggers usually want to create a website on Wordpress - a hackneyed stereotype, they have all been conquering Instagram, Tik Tok, Facebook and other social networks for a long time. Whereas WP is now developing commercial projects: web business cards, catalogs, news, corporate, information resources, and even online stores. Considering the release of a new update Core Web Vitals at this summer, all online platforms built with WP, and not just WP, need speed. Why? Let's consider further.

Creating a site on WordPress with an emphasis on fast loading

Imagine you spent a lot of effort and money to create a cool web resource with a detailed UX / UI, an interesting blog, interactive product cards, animation and other beauties. But we forgot about page speed. The page loads slowly, and the user, unfortunately, will never know about the work you have done. He will leave your web resource before he sees the content. If there are a lot of such signals from visitors, the search engine will also lower its positions in the search results, which will negatively affect the ranking of the site, the creation of which on WordPress you ordered, and invested your finances in this with the expectation of profit in the future, right?

Core Web Vitals для сайта на вордпрессAgain, we repeat, sooner or later Google will implement the announced Core Web Vitals, although it has already been transferred a couple of times, but the time obtained as a result of the transfer can be spent usefully, and prepare for a future update, which is based on three components:

  • LCP - primary display, content preloading,

  • FID - response time of page elements,

  • CLS - stability of layout.

We have already written about them in more detail in our article on the new algorithm.

To measure speed, it is recommended to use PageSpeed Insights, Pingdom, GTmetrix, Lighthouse Chrome extension. These tools generate a report based on the results of page crawling, the information in which will help you understand how to speed up the loading of your WordPress site. True, at least Google, at least third-party services, give recommendations based on the errors they found. Of course, the advice received should be taken into account, but it should be remembered that they are not exhaustive, and relying only on them in your work is not the best solution.

It's time to consider how to speed up your site if WordPress is chosen as the engine for it. And we will tell you both about the traditional methods of increasing the speed, and we will recall the methods that many developers for some reason forget about.

How to speed up a website on WordPress: universal solutions

Agree, it is better to immediately create a WordPress site that meets the requirements of the new algorithm than then play catch-up with a search engine. Therefore, even at the stage of developing sites on WordPress, we recommend checking the points described below.

Make a website on WordPress and choose a quality hosting

 

The first step in optimizing web resources on WP is hosting on a fast server. It is on the hosting that all the files of your online resource are stored. Therefore, the recommended server response speed should not exceed 200ms, and it should consist of faster SSD-drives.

Caching as a way to speed up WordPress

 

You can configure the data cache both locally, in the browser, and from the server side. In the first case, when loading the page, the client does not have to contact the server every time. After the first session, all data will remain in the user's computer memory, as a result of which each subsequent download will take less time. Browser caching is enabled in the .htaccess file through the Expires Header Caching code.

As for enabling the server cache, this is perhaps the first and most important thing to do when working out options on how to speed up your WordPress site. The cache on the server is needed so that the scripts and data used by the resource are not loaded again with each repeated access. The point is that heavyweight queries against MySQL are a weakness of many web sites. For WP, they are generated by plugins. And if earlier the problem was solved by means of the MySQL query cache, then in the latest version of the database there is no caching. Removed it due to scaling problems.

как ускорить WordPress One solution in this case is to install the Query Monitor debugger. It will help you identify plugins that generate heavyweight queries. After detection, you need to either disable them, or replace them with better analogues. If you still need to connect the MySQL response cache, we recommend using ProxySQL, an open source query proxying tool.

The second aspect is PHP cache. Since version 5.5 it is enabled by default through the OPcache extension. Thanks to this, the compiled page code is automatically saved in the server's memory.

As a result of correct operation of MySQL database queries and PHP scripts, an HTML file is generated, which is presented to the user as a ready-made web page. If the received HTML is stored on the server and given to visitors without re-accessing MySQL and PHP, the download speed will be as fast as possible. This method of speeding up a WordPress site is at the heart of most cache plugins. The generated page is saved as a file and, if necessary, is given to the user in a split second.

For server caching, plugins are most often used:

  • WP Super Cache,

  • W3 Total Cache,

  • WP Rocket.

An alternative solution is the Nginx cache. The principle of its operation is similar. But, when choosing the best method to increase your WordPress site's loading speed, remember that it is not recommended to use both Nginx and cache plugins at the same time. Although this may seem like a profitable idea, in practice webmasters get confused in a tiered cache, which negatively affects the functioning of the online resource.

CDN - Effective WP Acceleration Method

 

The site is not only MySQL queries and PHP scripts. It's also a bunch of static files:

  • styles,

  • fonts,

  • images,

  • java-scripts.

The speed of their uploading to WordPress depends on the size and geographic distance between the user and the server.

And if in the first case it is enough just to keep track of the file sizes, and not expect fast loading from a 10 MB picture, especially on the mobile Internet, then the second problem is solved by means of CDN - content delivery networks. The Content Delivery Network is a cluster of several servers located in different parts of the world. On each of them, copies of all files are stored in the cache, and the client, when visiting a web resource, receives the one that is located on the server closest to him.

It should be noted that not every website needs to create a CDN, and in some cases, spending money on this business is impractical. It makes sense to think about setting up a Content Delivery Network to speed up the online resources of large international corporations, whose customers and distributors are located in countries far from each other.

However, there is also a budget solution for companies with limited finances and a WordPress site - the W3 Total Cache + Cloudflare tandem will help you set up a CDN for free.

Optimizing code and content is the key to speeding up WordPress

 

In the first case, we are talking about shortening CSS and JavaScript files. If possible, it is recommended that you remove unnecessary HTML markup, comments, unnecessary lines and spaces from there. Yes, all this makes life easier for developers, but it makes files heavier, making them take longer to process by the browser.

ускорение WordPress оптимизация кодаAnother problem that is often encountered is the connection of all JS libraries, and in fact the use of a couple of pieces. Therefore, connect only what is really needed for the online resource. At the same time, we recommend making asynchronous loading of JS, and postponing the loading of scripts of third-party services, for example, web analytics.

Code optimization can be automated using one of the popular plugins:

  • Autoptimize,

  • WP Super Minify,

  • WP Fastest Cache.

In addition, the placement of CSS files at the beginning of the page, and JS files at the end will positively affect the loading speed. In this case, the browser will start processing scripts after loading the page content.

As for the content, then, first of all, you need to pay attention to the images. In most cases, a WordPress site that you can order from us is slowed down by heavy images weighing more than 1 MB. Therefore, it is necessary to fill a web resource with content using optimized images compressed to a suitable size. It is advisable to stick to the 200-600KB range. It is not recommended to add images larger than 1 MB. Alas, it is not always possible to maintain these norms. Of course, a couple of large images in general will not have such a negative impact, however, the pages where they are located may load worse than others.

Compliance with the requirements for image formats is also important. In particular, it is recommended to use:

  • JPEG — for still images,

  • PNG — for illustrations,

  • SVG — for icons.

Google's speed test reports often come across recommendations to replace current images with WebP images. This is a new format that has been shown Google research, at the same size is not inferior in quality to JPEG and PNG, but weighs less by 34% and 26%, respectively.

There is a wide range of both WordPress plugins and third-party resources for working with images. Among the most popular:

  • Optimus – WordPress Image Optimizer,

  • WP-Optimize,

  • TinyPNG,

  • Optimizilla,

  • Image Optimizer,

  • WP Smush,

  • Imagify Image Optimizer,

  • Clearfy,

  • Easy Fast Optimization,

  • EWWW Image Optimizer.

Image optimization is one of the most effective ways to speed up your mobile version of your WordPress site. After all, large images on mobile devices, especially when connected to 3G, 4G Internet, and not to Wi-Fi, load slowly and consume user traffic.

How to speed up a website on WordPress: solutions that are often forgotten

So, you have good hosting, a powerful server, optimized images, the cache is configured correctly, and the WordPress site still slows down - so it's time to try methods that people don't remember right away.

Database optimization

 

One of the features of the work of WordPress is that it saves all versions of posts, posts, drafts, in general, any modified or created pages. Naturally, all this information gets into the database, and it grows to an obscene size, slowing down the resource loading speed. Keeping changes on a per-post basis is a useful feature, but it is unlikely that you will ever need a copy of a year-old record.

You can solve the problem with a plugin, for example, WP-Optimize, WP-Sweep and any similar. Or, manually limit the number of versions through the wp-config.php file. It is enough to write in it the line define (‘WP_POST_REVISIONS’, 4). Where 4 is the number of saved versions of posts. It so happens that you do not need to keep the history of changes. Then with the line false: define (‘WP_POST_REVISIONS’, false) you can disable this option.

Hotlink protection and disable notifications about new links

 

In the first case, direct links to the files of your site on WordPress are placed on third-party resources. Images, videos, or PDF documents are most commonly affected. The load on your server is created due to requests that arise from a third-party resource when it is loaded. It contacts your host, requesting content, which is linked on the page being loaded. Protection plugins, All in One WP Security and Firewall and others will help prevent such scenarios.

Third-party link notifications are another aspect of how WP works. It is recommended to disable this option in the CMS settings, especially if you carry out SEO-promotion on the Internet. Notifications for each new link will create unnecessary load on the database.

Comments and feedback on WP posts

 

User Generated Content is undoubtedly welcomed by search engines, letting them know that the page is interesting to readers, and the web resource is popular on the Internet. However, the abundance of reviews and comments on the page significantly slows down its loading speed, slowing down the database. In this case, it is recommended to split them into pagination pages. In the engine settings, you can specify how many comments or reviews to display on the page. Thus, users will see the most recent ones.

Having checked the compliance with all the above points, and eliminated the problems found as a result of testing pagespeed, you can confidently count on a positive perception of the site by both users and search engines. After all, the faster the response speed of a web page, the better it is ranked by the search engine.

If it was not possible to completely eradicate the problems, we offer a few more life hacks on how to speed up a website on WordPress:

  1. Use an iframe to download videos and pull them from video hosting sites, not directly from your website.

  2. Remove any unused plugins so you can lighten the database.

  3. Check pages for 301, 302 redirects. If there are many of them, the Internet resource is loaded slower, especially if pages with 3xx server responses are present in the link.

You can order development on WordPress with primary SEO optimization from us. We create online resources that meet the download speed requirements of search engines. At the same time, the cost of a WordPress site depends mainly on the scale of the project and is negotiated individually with each client.

en_USEng