How to speed up a WordPress blog. WordPress: Plugins to speed up page loading, search engine optimization. Hosting speed - TTFB

WordPress is a great CMS for a website, but it is quite slow out of the box if not optimized correctly. In this guide, compiled by KeyCDN, we'll look at the basic ways to optimize and speed up your WordPress site.

WordPress is also one of the most popular CMS for company websites. More than half of the sites that can be defined as having a content management system are powered by WordPress. And this is more than 74 million sites.

According to W3Techs, WordPress is used on 60% of sites with a well-known CMS. This is 31.6% of all websites in the world.

Tools to measure site speed

One of the most important tools when working on website speed optimization is a page speed tool. We recommend taking measurements before starting optimization work, and during the process, after each change made. This will give you a better understanding of which parameter changes have a positive or negative impact on performance.

There are many tools to test your site's loading speed, including KeyCDN, which offers tests from 16 locations around the world.

The importance of website speed in 2018

Nowadays, website speed not only affects search rankings, but also provides a better user experience and increases conversions. Back in 2010, Google reported that site loading speed affects a site's position in search results. In 2018 speed mobile The version of the site also affects ranking.

Thus, if you want to increase organic traffic to your website from desktop and mobile, you should pay attention to properly optimizing your WordPress website.

Additionally, if you have an online store, faster website speed can increase conversions and bring in additional profits. Let's look at an example.

Limiting the number of post revisions in WordPress

In order to limit the number of post edits in WordPress, just add the following code to the wp-config.php file. It will change the autosave interval for entries from 60 seconds to 5 minutes and set the number of saved revisions to three. You can set the number of revisions to any number.

Define("AUTOSAVE_INTERVAL", 300); // seconds define("WP_POST_REVISIONS", 3);

Removing old post revisions from the WordPress database

After disabling or limiting the number of revisions, you need to clear the database of old saved revisions. For this purpose, you can temporarily install the WP-Optimize plugin.

This plugin will allow you to remove all unnecessary post edits, autosaving of drafts, spam, unapproved comments, temporary settings and other garbage. In the new version of the plugin, it allows you to enable auto-cleaning according to a specified schedule.

Watch out for the 100 page limit in WordPress

When planning the site structure, it is worth remembering that WordPress was not designed to work with a large number of pages, more than 100. If there are a large number of pages on the site, the admin area will start to slow down due to lack of memory. However, this will not affect the frontend in any way. There is a mention of this limitation in the WordPress documentation.

Pages have a hierarchy. And any actions with pages require loading a whole tree of templates on the backend to determine the relationship of the pages with each other. When a record is called, it has nothing to do with other records except the date, and processing it does not require loading a large amount of data. It's worth remembering that WordPress was intended to be a blogging platform, not a multi-page website.

A solution to this problem could be to use custom post types. For this task, you can use the free Post Type Switcher plugin if you need to convert a large number of pages into custom post types.

5. Optimizing Images Using Compression

On modern websites, on average, 56% of page weight is images. Therefore, image optimization and compression should be a priority when speeding up your WordPress site.

Depending on the specific file, the image can be compressed up to 70% of its original size. You can compress images at the stage of preparing them for publication in a graphics editor, or already on the site using special image compression plugins for WordPress.

6. Gzip/Brotli compression

Gzip is another compression technology that is used to compress pages, styles, and scripts at the server level before sending them to the browser. You can check if Gzip compression is working on your WordPress site using the Check GZIP Compression service.

Apache

You can configure compression on the Apache server by adding the following code to the .htaccess file

# Compress HTML, CSS, JavaScript, Text, XML and fonts AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE application/x-font AddOutputFilterByType DEFLATE application/x-font-opentype AddOutputFilterByType DEFLATE application/x-font-otf AddOutputFilterByType DEFLATE application/x-font-truetype AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterB yType DEFLATE font/ opentype AddOutputFilterByType DEFLATE font/otf AddOutputFilterByType DEFLATE font/ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE image/x-icon AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/java script AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/xml # Remove browser bugs (only needed for really old browsers) BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0 no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html Header append Vary User-Agent

Nginx

If you are using the Nginx web server, compression is enabled by including the following instructions in the nginx.conf settings file.

Gzip on; gzip_comp_level 2; gzip_http_version 1.0; gzip_proxied any; gzip_min_length 1100; gzip_buffers 16 8k; gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; gzip_disable "MSIE .(?!.*SV1)"; gzip_vary on;

In addition, you can also implement compression technology Brotli on WordPress. Brotli This is a new compression algorithm developed by Google. Brotli shows a significant advantage over Gzip when compressing files.

7. Reduce the number of WordPress plugins

A common reason for WordPress slowdowns is a large number of installed plugins that load the server. To maintain optimal performance of your WordPress site, you should limit yourself to the minimum possible number of plugins.

There are plugins that allow you to evaluate the degree of influence of installed plugins on the speed of the site, but they are outdated and not supported by the developers. These are plugins P3 Plugin Performance Profiler And WP Performance Profiler

When installing new plugins on a WordPress site, you should pay attention to the date the plugin was last updated and whether it is compatible with the current version of WordPress. If the plugin has not been updated for a long time, you will see the following warning:

It is recommended that you refrain from using such plugins on your site as they are no longer supported and may cause performance and security issues. In addition, if it is possible to implement the necessary functionality without using a plugin, by editing the code, this should be done.

The quality of your plugins can also have a significant impact on the performance of your WordPress site. Not all plugins are written by professional developers, and you should compare several plugins that solve the same problem in order to choose the fastest and most optimized one.

8. Optimizing Web Font Performance

According to research, in 2018, 57% of websites use non-standard fonts, an increase of 850% compared to 2011. It is very important to use only the fonts you need, in WOFF and WOFF2 formats. Services like Typekit base64 convert fonts to all possible formats, thereby slowing down the site loading speed.

According to the test results, Google fonts show a good level of performance because they use a CDN for downloading and are provided only in WOFF formats. Open Sans- the fastest of 10 popular fonts.

It is also important to remember the difference between Google fonts and secure web fonts, it can be up to 200 ms. This is mainly due to loading speed and additional HTTP requests to Google servers.

Another optimization opportunity could be to move Google fonts to your CDN. In benchmark tests, loading fonts from your CDN is faster than from Google because there are fewer HTTP requests, DNS lookups, and more control over caching.

You can go even further and put all the fonts in a separate css file and store them in localStorage. The browser cache is reset quite often, especially on mobile devices. And by saving files in localStorage, the user can store them permanently. Smashing Magazine saved 700ms on page load using localStorage.

We recommend using the localFont tool from Jaime Caballero. You can drag your font into the window and convert it into CSS and Javascript for placement on your WordPress site.

9. Font Awesome Icon Optimization

If you use Font Awesome, you can speed up their loading time by placing the files on a CDN. If you are using a WordPress theme with Font Awesome, it will need some tweaking.

Storing Font Awesome on your CDN will reduce the number of server requests and DNS lookups.

10. Lazy Load for Images, Videos and Disqus

Lazy loading is a technology for loading an object only at the moment when it is needed. In the case of WordPress, this means that the element does not load until the user scrolls to it. Lazy load can be applied to any page element, from images and videos to the Disqus comment block.

Lazy loading of images

To lazy load images on a WordPress site, you can use a good free plugin BJ Lazy Load. It replaces all images, labels, and frames on a page with placeholders and loads content as it approaches the window border as the user scrolls. This also works for text widgets. If you use the WP Rocket plugin, it has settings to enable Lazy Load.

Lazy loading of videos

To lazy load videos on WordPress, you can use the free Lazy Load for Videos plugin. It replaces embedded Youtube and Vimeo videos with a clickable preview image. If you have a lot of videos on your site, this plugin will help significantly improve page loading speed.

Disqus Lazy Loading

Disqus is a very convenient commenting system that fights spam very well. But the standard Disqus plugin creates more than 10 HTTP requests, which can significantly slow down page loading. To solve this problem, developer James Joel made the Disqus Conditional Load plugin, which delays loading Disqus. It also does not harm SEO, meaning search engines can still index comments.

11. Minification and merging of CSS and Javascript files

Minifying and merging stylesheets and script files can play a significant role in speeding up your WordPress site.

Minification

File minification means removing extraneous characters from HTML, Javascript, and CSS files, such as:

  • Spaces
  • Line breaks
  • Comments
  • Block separators

This optimization reduces the amount of loaded code and has a positive effect on site speed.

Union (concatenation)

Concatenation is the process of combining multiple stylesheets or scripts into one in order to minimize the number of HTTP connections. Sometimes this can have a positive effect, but sometimes it can slow down page loading due to large files having to be downloaded. The effect of this function must be tested on a case-by-case basis.

To minify and concatenate files in WordPress, you can use plugins, for example, WP Rocket

Most caching plugins for WordPress have a setting to enable these features, but you can also use standalone plugins such as Better WordPress Minify and Autoptimize. A good practice in WordPress is to place style files at the top of the page and script files at the bottom.

12. Reducing the number of HTTP requests

Reducing the number of HTTP requests a WordPress site makes when loading is very important for optimizing speed.

Let's look at several important ways to reduce the number of requests to the server.

Gravatars

If you use the WordPress commenting system on your site, by default it generates a separate HTTP request for each gravatar. If you have a lot of comments on a page, it will generate a huge number of necessary and unnecessary redirects.

There are several ways to solve this problem.

Option 1 - disable gravatars

You can simply disable all user gravatars and use local avatars. Not an ideal solution, but a working one.

To do this, you need to install the free WP User Avatar plugin. And in the settings, enable the option “Disable Gravatars and use only local avatars”

Option 2 – Use Disqus

You can use Disqus comments in conjunction with the lazy load Disqus plugin. It seems strange that connecting an additional plugin, scripts, or making calls to third-party services is preferable to using native functionality. But if you compare the speed of a post with 5 or more comments, it turns out that Disqus is faster due to fewer HTTP requests.

Disabling Emoji

With the release of WordPress 4.2, Emoji support was added. This led to the addition of an extra wp-emoji-release.min.js?ver=4.3.1 script in the header. This script creates an additional HTTP request that you need to get rid of if you don't intend to use Emoji.

In the instructions below we will show you how to disable Emoji and get rid of the unnecessary HTTP request.

In the Writing settings, turn off “convert emoticons”.

Option 1 – WordPress plugin

Install the free WordPress plugin “Disable Emojis” by Ryan Hellyer. This plugin disables emoji functionality in WordPress 4.2.

Option 2 – WordPress Function

To avoid overloading your site with unnecessary plugins, you can get rid of emoji by adding the following code to functions.php:

/** * Disable the emoji"s */ function disable_emojis() ( remove_action("wp_head", "print_emoji_detection_script", 7); remove_action("admin_print_scripts", "print_emoji_detection_script"); remove_action("wp_print_styles", "print_emoji_styles") ; remov_print_styles "," admin_print_emoji_styles "); , "wp_staticize_emoji"); , "disable_emojis_tinymce" ) add_action("init", "disable_emojis"); /** * Filter function used to remove the tinymce emoji plugin. * * @param array $plugins * @return array Difference betwen the two arrays */ function disable_emojis_tinymce($plugins) ( if (is_array($plugins)) ( return array_diff($plugins, array("wpemoji")); ) else ( return array(); ) )

Disabling scripts on a page

We usually try to get rid of unnecessary plugins, but there is one Gonzalez plugin that allows you to disable unused scripts at the page or site level. For example, the Contact Form 7 plugin loads its scripts on all pages of the site, and not just on the one where forms are used. The same thing happens with social network sharing plugins. By disabling scripts that are unnecessary on this page, you can get rid of several unnecessary HTTP requests. The plugin is not free, but it is worth the money.

Disable Embeds

Since version 4.4, a new wp-embed.min.js script is loaded into WordPress, which makes it easier to insert videos, images, tweets, etc. For example, WordPress will automatically convert the URL into a YouTube embed and create a preview in the visual editor. But not everyone needs such a function; you can simply copy the ready-made embed code from YouTube or Twitter. The problem with this function is that it loads its own script on every page. There are several ways to get rid of it.

Option 1 – WordPress plugin

Install the WordPress plugin “Disable Embeds” by Pascal Birchler. It does the following:

  • Prevents others from embedding your site.
  • Prevents you from inserting sites not from the allowed list.
  • Disables all scripts associated with this feature.

Option 2 – WordPress Function

You can add the following code to your functions.php file, this will disable the insert feature.

// Remove WP embed script function speed_stop_loading_wp_embed() ( if (!is_admin()) ( wp_deregister_script("wp-embed"); ) ) add_action("init", "speed_stop_loading_wp_embed");

Disable comments

Regardless of whether you use the WordPress comment system or not, the comment-reply.min.js script is included on every page of the site. This is not always justified; the site may not need comments at all or Disqus may be enabled. Then you can disable this unnecessary script.

To do this, you can add the following code to your functions.php file.

// Remove comment-reply.min.js from footer function comments_clean_header_hook() ( wp_deregister_script("comment-reply"); ) add_action("init","comments_clean_header_hook");

13. Disabling hotlinks

Hotlinking is when someone uses images from your site and links to them. This creates unnecessary load on the server and unnecessary traffic. You can prevent such things by adding the following code to the .htaccess file:

RewriteEngine on RewriteCond %(HTTP_REFERER) !^$ RewriteCond %(HTTP_REFERER) !^http(s)?://(www\.)?yourdomain.com RewriteRule \.(jpg|jpeg|png|gif)$ –

After this, images on other sites that are trying to link to yours will look like this:

14. Disabling Pingback and Trackback

Pingback and trackbacks are considered outdated now, and can slow down your site as pages load. There are many modern tools that allow you to track links to your site.

You can disable pingback and trackback in the discussion settings. This change will only affect new entries.

15. Setting image sizes

Optimization suggestion: “By compressing and adjusting the size of … you can save 5.8 KB (51%).”

These guidelines apply to images on the site that are scaled by the browser. For example, if an image is 500 pixels wide, but on the page it is placed in a 400 pixel wide column. As a result, it will be reduced to 400 pixels.

The right solution would be to prepare images of the required size in a graphics editor before uploading them to the site. This will save server resources and comply with Google Pagespeed guidelines. You can also upload images to the site in different sizes for different devices.

16. Solving the problem of slow loading admin-ajax.php

WordPress 3.6 introduced the WordPress Heartbeat API, which allowed WordPress to communicate with the server and browser. This has improved session management, revision control, and autosaving.

The WordPress Heartbeat API uses admin-ajax.php for AJAX requests from the browser. This can result in increased CPU usage and a large number of PHP calls. For example, if you leave the admin page open, it will send POST requests to this file constantly at a specified interval.

There is a free Heartbeat control plugin that allows you to set the frequency of calls to the WordPress heartbeat API.

It is worth remembering that developers of other plugins also use this file. If you notice delays in your site, it may be caused by a plugin that is requesting admin-ajax.php. To figure out what's going on, you need to run a site loading speed test, find the admin-ajax.php call and look at the request information.

This way you can figure out which plugin is executing the request. In this example, it was a social media plugin that did not have caching enabled. As soon as the plugin caching was activated, the constant calls to admin-ajax.php stopped.

17. Setting up a MySQL server

Optimizing the MySQL database server is also very important for the fast operation of a WordPress site. MySQL settings largely depend on the configuration of the server environment on your hosting, so there are no universal recommendations for optimizing MySQL. Typically MySQL/MariaDB settings are located in the /etc/my.cnf file. Here are a few parameters whose values ​​are worth paying attention to:

  • tmp_table_size
  • query_cache_type
  • query_cache_size
  • query_cache_size
  • join_buffer_size
  • max_heap_table_size

A very useful tool is the MySQL Tuner script. It provides an overview of server performance and makes some basic recommendations for possible optimizations. Here are a few more tools that may come in handy when configuring MySQL:

18. Choosing a quality hosting for WordPress

And the last but not least important factor in optimizing a WordPress site is choosing a reliable, productive hosting. We do not recommend using cheap shared hostings that are crammed with sites. The best solution would be to use VPS or WordPress hosting with support.

We hope our guide will help you improve your website speed performance.

Original article - https://www.keycdn.com/blog/speed-up-wordpress/

Hello, dear readers! Today we have a very important and interesting article from the “wrap around” category. How to speed up WordPress, so that blog pages load 3 times faster, and the load on hosting is reduced by 2 times!

There is already an article on my blog dedicated to this, but practice has shown that the measures listed in it are not enough. The time that I struggled with hosting was not wasted. It gave me a reason to start optimizing my blog again. The result of painstaking work was the acceleration of WordPress by 3 times and a reduction in the load on hosting by approximately 2 times. Very good results, considering that my WP was not in such a bad state. I would even say that the patient was more alive than dead. Eh, there is no limit to perfection!

I would highlight the 10 most important steps to speeding up WordPress. Let's look at each of them in detail.

1. Page caching.

Perhaps this is the most important point, which you cannot do without. The operating principle of WP (and most other CMS) is such that blog pages are not stored on the server in static HTML format, but are generated based on PHP code when the user navigates to it. For each user, each page is generated again and again! This entails unnecessary consumption of server resources and significantly increases page loading time.

The principle of caching is simple - a static HTML version is created for a page, which is given to all users who switch to it and exists for a certain time (cache lifetime), after which it is updated. Physically, this page is a file in html format, which is located on the server in a separate directory.

I wrote this whole theory here with only one purpose, so that you understand the simple truth - there is no life without caching! Even if a couple of people visit the blog, in addition to them there are such hidden guests as search engine bots. They will definitely find fault with the loading speed of blog pages. To implement caching in WordPress, I recommend using one of the following plugins:

  • — perhaps the most popular caching plugin;
  • Super Cache - currently using it.

Choose any of them. They are similar in quality and functionality.

2. Optimization of wp plugin scripts and styles.

Each new WordPress plugin adds its own files with scripts and styles; when creating a page, they all need to be connected. This takes some time. To save it, all additional style files (and scripts) should be combined into one file, which will later be included. Don’t worry, I won’t force you to do this manually (although you could, just for fun), because there is a wonderful one.

3. Reducing the size of the style.css file.

There is a wonderful service that allows you to optimize and compress the style.css file by removing unnecessary spaces and indents. Of course, subsequently working with such a file is extremely inconvenient, so I strongly advise you to keep a copy on your computer in a normal form accessible to human perception.

In addition, if you constantly rework your theme (like me), then over time, styles that are not used anywhere accumulate in the style.css file. Such “dead” elements should be disposed of in a timely manner. To track them, I use the free Dust Me Selectors add-on for the FireFox browser. You can download it.

4. Optimization of the language pack.

There are no trifles in the matter of speeding up WordPress; you need to compress and reduce everything that is possible, even a file with a Russian language. I won’t describe this process for a long time, because it all comes down to banal use. Enjoy it for your health!

5. Cleaning the header.php template from unnecessary PHP code.

I just strongly recommend that before any work with the database, you create a backup copy of it (plugin). If you forgot to take a backup copy of your database and something went wrong, don’t be alarmed! If you use, then there is always a fresh backup there. Just roll back to it and it's izgt.

7. Testing the loading speed of plugins, removing the heaviest ones.

10. External factors.

I recently encountered this evil. Its essence lies in a large number of requests from the same or different IP addresses. The main goal is to increase the load on the server to slow down the blog or completely crash it (DDOS attack).

For a long time I didn’t even suspect about this problem, only the blog began to slow down and produce errors from time to time. After switching to Hostenko hosting, the blog was constantly turned off due to high load on the server. The technical support service did not provide any assistance, they simply offered to optimize WP on their own or purchase a VPS for a lot of money.

As a result, I moved my blog to, where they helped me identify and fix this problem, for which I am very grateful to them. The guys really work very efficiently and quickly. The solution was to ban the most active IP addresses and filter requests to some WP files.

As you can see, the load on the server has been reduced by almost 2 times, and the blog has become noticeably faster.

Tell me, could you solve a similar problem on your own without outside professional help? Personally, I don't. So follow my example - choose a really high-quality hosting so that its technical support is able to solve problems of any complexity, and does not leave you alone with them.

While working on speeding up WordPress, your blog needs to be constantly tested to identify problem areas. Perhaps the most interesting and useful free online testing service for blog loading is tools.pingdom.com. It was thanks to him that I tracked down the connection of an unnecessary JavaScript library and identified a couple of unreasonably heavy images.

And here are the results according to the WebWait service, which my blog showed in the end:

Simply gorgeous! I sincerely wish that your blog works just as quickly! Believe me, this is not so difficult to achieve.

That's all for today. If you know other ways to speed up WordPress, don’t hesitate to leave your comments. My readers and I will greatly appreciate it.

Thank you, friends, for reading my article to the end. I hope it really helped speed up WordPress and your blog. Take care of yourself!

Hello dear readers! In this lesson we will talk about how to increase site page loading speed on WordPress and reduce the site load on the server.

I think you will agree that operating speed site is almost the most important indicator. Even if your site has the best and most useful content, but the pages take 8-10 seconds to load, sooner or later this will begin to irritate visitors.

And if we add to all this a large number of site visitors, the load on the hosting server will be simply enormous.

If your site is already fast, you have the opportunity to accelerate it to the speed of light with the help of this lesson :)

How to speed up your WordPress site?

1. Optimize your WordPress site database

Database optimization is a very important point. If there is a lot of “garbage” in your database, this creates additional load on the server. Clearing junk data will significantly reduce the load on hosting. We talked about how to clean and optimize the database in.

2. Disable unused plugins

A large number of unused plugins also creates additional load. Disable unnecessary plugins and, if possible, reduce the use of unnecessary scripts.

3. Optimize your images

Images on a website page usually take up a lot of space and weigh the most. The more an image is compressed, the faster the browser can display the page to a site visitor. Thanks to image optimization you can significantly improve operation of the web resource.

This mistake is usually made by beginners, but it cannot be ignored. I plan to devote a separate lesson to this soon.

4. Use normal hosting

Hosting is the place where your website will be hosted, and its trouble-free operation very important. You won’t get anything good from free hosting (they can only be used for training), and spending money on expensive ones doesn’t always make sense. Therefore, I recommend choosing the optimal hosting, based on the needs of your site and financial capabilities.

Personally I use hosting ukraine.com.ua. I've been using it for almost two years now without any complaints. I can point out the positives low price, reliability and quality of services provided (+ 24/7 support).

5. Caching the site

Caching is capable increase download speed many times over Your site! You can learn about this from previous lessons.

By using caching, you will significantly increase page loading speed and reduce the load on the server. I recommend to mandatory use.

6. From the world by thread

For those for whom what was described above (God forbid) was not enough, I recommend the following:

  • Shorten your CSS and JavaScript code
  • Reduce the number of database throws
  • Update WordPress to the latest version
  • Use VPS hosting

Friends, I wish you high attendance and stable work site.

If you have any questions or want to share your experience in solving this problem, write in the comments!

Hello dear readers! In this lesson, we will talk about how to increase the loading speed of website pages on WordPress and reduce the website load on the server. I think you will agree that site speed is practically the most important indicator. Even if your site has the best and most useful content, but the pages take 8-10 seconds to load, sooner or later this will begin to irritate visitors. And if we add to all this a large number of site visitors, the load on the hosting server will be simply enormous. If your site is already fast, you have the opportunity to accelerate it to the speed of light with the help of this lesson :) I would like to immediately...

Hello everyone, friends. A variety of users around the world today use WordPress to create their websites on completely different topics and areas. As a result, almost half of the sites that are based on any CMS at all work on this content management system. Today this is about 74 million sites (statistics). And of course, the question of how to properly, safely and maximally speed up your WordPress site is extremely relevant for many.

In this article we will tell you about the most effective methods tested by various specialists. However, this certainly does not mean that you need to urgently and thoughtlessly adjust your website to all the points listed below. Some points are more or less individual, and if you use only part of them, this will already be a good result.

So, let's overclock our beloved WordPress in 2017. Go!

1. Use a reliable framework/theme

Behind every WordPress site lies a theme or framework, and this can sometimes lead to problems. Each topic is written differently, and therefore some topics are often better than others. Default WordPress themes like Twenty Fifteen are very fast because they are lightweight.

Be careful when purchasing themes from mega popular sites like ThemeForest and Creative Market. While there are many great themes out there, you have to understand that developers often add features just to increase sales. So the main thing is to find the right developers. And these are the ones we talk about more than once on the pages of this site.

Also, such lightweight frameworks as Thesis Theme framework and Genesis are also known for developing fast and well-written themes based on them.

2. Using caching

Caching is another important factor to consider if we want to overclock WordPress. Caching allows you to store your pages and posts as static files, which are then delivered to your visitors, minimizing the loading process on your server. You can use caching by using WordPress caching plugins and thereby implementing browser caching and server-side caching.

Caching plugins

Here are some of the best free and paid caching plugins:

Installing and properly configuring a caching plugin can lead to a 200-300% increase in performance!

PHP bypass for cached pages

Below is a more advanced Nginx PHP bypass configuration for page caching. This example is optimized for the Cache Enabler plugin.

Nginx configuration example

Set $cache_path $request_uri; # bypass cache if query string not empty if ($query_string) ( set $cache_path "nocache"; ) # bypass cache for POST requests if ($request_method = POST) ( set $cache_path "nocache"; ) # bypass cache for admin area if ($request_uri ~ /wp-admin/) ( set $cache_path "nocache"; ) # bypass cache for logged in users if ($http_cookie ~ (wp-postpass|wordpress_logged_in|comment_author)_) ( set $cache_path "nocache" ; ) location / ( try_files /wp-content/cache/cache-enabler/$(http_host)$(cache_path)index.html $uri $uri/ /index.php?$args; )

Browser Caching – Add Expires Headers to WordPress

You can also add browser caching by adding expires headers. Expires headers tell the browser whether they should request a specific file from the server or whether they should grab them from the browser cache. By adding them you can reduce the number of HTTP requests they require. Some caching plugins for WordPress allow you to add them, but you can also just add the code to your file .htaccess

# Enable expirations ExpiresActive On # Default directive ExpiresDefault "access plus 1 month" # My favicon ExpiresByType image/x-icon "access plus 1 year" # Images ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" # CSS ExpiresByType text/css "access plus 1 month" # Javascript ExpiresByType application/javascript "access plus 1 year"

Server caching

In addition to WordPress caching plugins and browser caching, you can take advantage of server-side caching. This type of caching is usually used on sites with a lot of traffic. Caching with Varnish can be very powerful when combined with a caching plugin and CDN.

Prefetch commonly used domains

Prefetching is something similar to caching in the sense that you are also telling a browser like Chrome to look up the DNS settings before they are actually needed. Thanks to this, pages and requests from any prefetched domains that are not yet cached are flashed, and they begin to work faster.

You can use prefetch for domains in WordPress by adding the domain syntax to your header.php file between the tags . This process is not blocked and will only be enabled when possible. Here are common examples.

Prefetch Google fonts:

Prefetch Google code (jQuery)

Prefetch Google Analytics

Removing Query Strings from static resources

You may also benefit from removing query strings from your static resources, as they can cause problems with cache proxies and CDNs. WordPress has a couple of options for this.

Edit your file functions.php to include a function there that will remove query strings.

Function _remove_script_version($src)( $parts = explode("?ver", $src); return $parts; ) add_filter("script_loader_src", "_remove_script_version", 15, 1); add_filter("style_loader_src", "_remove_script_version", 15, 1);

If you are using a caching plugin like W3 Total Cache, then you have an option that prevents query strings from being created. There are free WordPress plugins that can also remove query strings, and these are the Query Strings Remover and .

3. Implementation of a Content Delivery Network

No matter how large your WordPress installation is or how much traffic you receive, you will still benefit from implementing a content delivery network (CDN). A CDN takes all your files (CSS, Javascript, images) and delivers them to a server closer to the visitor, reducing loading times. In addition to the speed bonus, a content delivery network can also create a positive impression of your site, improve its ranking, increase the time your visitors spend on the site, improve conversions and even SEO.

Loading all assets from WordPress CDN

Make sure you load even the smallest files, such as a favicon, from your CDN. If everything is downloaded from the CDN, then one single connection is created. To tweak your favicon, simply drop it into the root directory of your WordPress installation using FTP, then add the following to your header.php between the head tags.

As you can see from the example below, 100% of your assets are loaded from the CDN.

4. WordPress Database Optimization

WordPress tends to slow down if your database is not optimized properly. You can keep your database clean by disabling or limiting the number of old versions, deleting old versions, and limiting the number of WordPress pages to 100 units.

Disable and limit the number of post versions in WordPress

WordPress creates multiple versions of posts as you write content. If you are not very careful, you may have thousands of unnecessary versions accumulated in your database.

To solve this problem, you can either disable the creation of post versions altogether, or limit their number.

Disable versioning of WordPress posts

To disable versioning of posts in WordPress, you need to add the following code to your file wp-config.php. This way you will first change the default auto-save interval from 60 seconds to 5 minutes, and then completely disable the creation of post versions. By default, there will be one auto save per post.

Define("AUTOSAVE_INTERVAL", 300); // seconds define("WP_POST_REVISIONS", false);

There is also a free little plugin called Disable Post Revision. It does the same thing without having to dig into the code.

Limiting the number of saved versions of WordPress posts

To limit the number of versions of WordPress posts that can be created, you need to add the following code to your wp-config.php file. This will change the default autosave interval from 60 seconds to 5 minutes and limit the number of versions created to three. However, you can specify any desired number of saved versions.

Define("AUTOSAVE_INTERVAL", 300); // seconds define("WP_POST_REVISIONS", 3);

Removing old versions of posts from your database

Once you've disabled or limited the number of post versions created, you'll need to clean everything up by deleting old versions. To do this, we recommend temporarily installing a free plugin.

With this plugin you can remove all old versions, saved drafts, spam comments, unapproved comments, pingbacks and trackbacks. The latest WP-Optimize also allows you to enable auto cleaning according to a predetermined schedule.

WordPress 100 page limit warning

You should know that WordPress is not designed to handle more than 100 pages. If you accumulate more than 100 pages, then you will start to have memory problems, and you will notice that the site’s work has slowed down significantly on the backend side. Your frontend will not slow down.

Pages have their own hierarchical tree. So everything regarding pages ends up loading the entire hierarchical tree of pages in the backend area. This is necessary to establish how this page is connected to others. When we are dealing with records, there is no connection to other records, and only the data of the related record is present, so there will not be as much to load here. Remember that at its core, WordPress is a blogging platform.

Solution? You need to start using custom post types. You can use a free plugin like Post Type Switcher if you have a lot of pages and want to convert them to custom post types.

5. Optimize your images using lossless compression

On average, images make up 56 percent of the page weight of a standard website. So image optimization and compression should be high on your priority list. Lossless compression is a method that allows you to compress images, reducing their size, but without affecting their quality.

6. Gzip compression

18. Choose a reliable web hosting

In overclocking WordPress, reliable and fast hosting plays an important role. We recommend staying away from cheap solutions because their servers are overcrowded. It is best to use VPS or hosting with WordPress administration.

About the most budget-friendly and proven ones in .

Research shows that people are not very patient when it comes to the Internet. About 23% of people don't wait for a page to load if it takes more than 4 seconds. This may seem like a very harsh statistic, but achieving this result is not that difficult. If you can reduce the site loading time to 2.9 seconds, then this will be enough for the site loading speed to be faster than half of the existing ones. This means that even minor website improvements can lead to tangible benefits for your business. Since about a quarter of websites run on WordPress, it is not surprising that users want to increase the site loading speed on WordPress.

In this guide, we'll show you how to increase your website's loading speed in 9 easy ways. You don't need to be a programming guru to easily follow our instructions. Using this guide, you will not only reduce the number of users who leave without waiting for loading, but also significantly improve the SEO component of the site!

Before you start this guide, you will need the following:

  • Accessing the WordPress Dashboard

Step 1 – WordPress Speed ​​Test

Before we begin the process of optimizing your WordPress, we need to know how your site stands in relation to others. Speed ​​testing is not just a formality, if your site's loading speed is already optimal then you won't need to follow this guide. There are many useful tools to check your website's performance. One of the most popular is the GTmetrix tool. In addition to measurement tables, he gives tips on how to improve their performance. However, if you want to compare your results with those of other sites, we can recommend the Pingdom service.

Step 2 – Remove Unneeded Plugins and Themes

We frequently add new features to our site to make it modern and relevant. In WordPress this happens through plugins and themes. Quite often, new plugins and themes replace the functionality of the original site. Over time, you may find a huge number of plugins on your site that have not been used for quite some time.

A large number of these types of plugins can seriously degrade WordPress performance. As a basis for our future optimization process, you should remove or at least disable unnecessary plugins. Ideally, only those plugins that are necessary for the full operation of your site should remain. Check out our guide to .

Step 3 – Minify CSS, HTML and JavaScript

Minification is one of the most useful processes for increasing the speed of a website. It consists of reducing the size of files and scripts (HTML, CSS, JS) by removing unnecessary characters such as spaces and comments from these files.

Plugins that can help you with the minification process: Autoptimize and W3 Total Cache. For a more detailed analysis of the minification process, refer to.

Step 4 – Enable Gzip Compression

In addition to file minification, you can also benefit from a separate form of compression also known as Gzip compression. Basically, whenever someone visits your site, resources (files) are retrieved from your server. The more resources, the more time it takes to load them on the user side. By enabling Gzip compression, you can significantly reduce the size of these resources, thereby speeding up the WordPress loading process.

To check if Gzip compression is enabled, use checkgzipcompression.com. If not, then edit the file adding the following code to it:

AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE image/x-icon AddOutputFilterByType DEFLATE image/svg+xml AddOutputFi lterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/ javascript AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/x-font AddOutputFilterByType DEFLATE application/x-font-truetype AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterB yType DEFLATE application/x -font-otf AddOutputFilterByType DEFLATE application/x-font-opentype AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE font/ttf AddOutputFilterByType DEFLATE font/otf AddOutputFilterByType DEFLATE font/opentype # For Older Browsers Which Can't Handle Compression BrowserMatch ^ Mozilla /4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0 no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

You will also be able to find a guide on this topic on your server. Also, plugins like WP-Rocket can automatically enable Gzip compression on your site.

Step 5 – Optimizing Images

You might think that because they are static, images don't have much of an impact on site loading speed. But it's quite the opposite - high-quality images have a huge impact on almost all the assets on your site. However, this does not mean that you should abandon clear images in favor of small and blurry thumbnails. There are many ways to optimize your website images. For example, the WordPress plugin – Smush Image Compression and Optimization provides a convenient way to achieve higher performance without losing image quality. For more detailed information on this topic, see a separate one.

Step 6 – Dividing Long Content into Pages

Another piece of advice you may have come across when looking for ways to optimize WordPress is pagination. This process means dividing large content into smaller parts and then displaying those parts separately on different pages.

Pagination is often used for the comments section because loading thousands of comments on a single page has a significant impact on server resources. In WordPress you can easily enable pagination - just go to the section Settings, Further Discussion. Here you can specify the maximum number of comments for the page. It is recommended to indicate the average value. A small number of comments on a page can also cause a negative effect, since the user may not want to constantly go to the next page to view them.

In addition to a comment section, pagination can help you break up an article. This can be quite useful for large articles, since users don't always like a lot of text. Pagination can be achieved by adding code nextpage –> into the text version of your article. WordPress will automatically detect the code and do the pagination.

Step 7 – How to Increase Website Loading Speed ​​by Changing PHP Version

This is one of the lesser known tips. However, it is also one of the most effective for increasing website loading speed. Upgrading from PHP 5 to PHP 7 may seem quite daunting, but the benefits speak for themselves. WordPress performance increases 2 times when using PHP 7 compared to PHP 5; the former can process 112% more requests/second than the latter. Moreover, WordPress gets a nice performance boost thanks to the memory optimizations of PHP 7. That's why PHP 7 is installed as the standard version of PHP on all our shared hosting plans, .

However, one important thing to keep in mind is that PHP 7 is not backwards compatible. This means that you will not be able to use certain plugins and themes, including those that work fine on PHP 5. To check which plugins and themes are on your WordPress is not supported by PHP 7, use PHP Compatibility Checker.

Step 8 – Using Caching Plugins

Caching is a well-known mechanism that allows you to reduce some of the load on the server. Basically, a cache stores information that is frequently used on the client system (browser, memory) so that the browser does not have to re-fetch this information from the server. Caching can significantly improve site performance and is therefore one of the most effective methods for improving WordPress performance.

There are a huge number of plugins available for WordPress that offer different types of caching, WP-Rocket and W3 Total Cache.

Step 9 – Using a Content Delivery Network (CDN)

Thanks to the lightning-fast speeds of the Internet, it's easy to forget that, after all, web pages are located on real hardware located quite a distance away from you. And sometimes this distance is so great that it can negatively affect response time. Most websites solve this problem by using a Content Delivery Network (CDN).

When you enable a CDN on your site, the client's browser no longer needs to fetch every page from the server, but rather some static pages are hosted in the data centers closest to the visitor. This reduces the overall number of requests processed by the server, which improves WordPress performance.

The choice of CDN is simply huge. The most popular ones are Cloudflare and MaxCDN. We have prepared a separate guide for setting up Cloudflare for your WordPress site, which you can find here.

Conclusion

In this guide, you learned how to increase the loading speed of your WordPress site using some tweaks and plugins. By following these steps, you can significantly increase the performance of your WordPress site.

For more WordPress tips and information on other topics, visit our section.