How to improve the speed of my WordPress: Complete WPO Guide

Digital Marketing, SEO

Do you want to improve the speed of your WordPress site?

We have all suffered at some point because a website is not as fast as we would like it to be.

When we become web users we are lazy and impatient, which means we like to enjoy fast and intuitive websites.

A fast loading of your website improves the user experience, which translates into an increase in visits and helps SEO (Google also likes fast websites).

In the case of WordPress you’ve surely heard about optimizing image load times, reducing installed pluginsbut there’s a lot more you can do .

For that reason, in this article we will share the ultimate guide on how to speed up your WordPress website: we will teach you step-by-step WPO(Web Page Optimization) techniques, methods and tips to improve the loading speed and increase the performance of your WordPress installation.

What is WPO?

If you have a website, you surely know how important it is that it is optimized to attract traffic and generate sales. However, what does this website optimization consist of?

WPO, orWeb Page Optimization, encompasses all the techniques used to increase web performance at all levels, improve SEO, capture traffic, and convert sales. However, the most famous and well-known definition of WPO is the one that refers to performance in terms of loading speed.


Measure your WordPress loading problems

There are different ways to check the loading speed of your WordPress. The most famous is undoubtedly the official Google PageSpeedInsights, although for less advanced users it can be somewhat difficult to interpret the data provided by PSI.

 

gtmetrix logo
GTmetrix tells you in seconds what is slowing your WordPress down

In our case we will use GTmetrix, a tool developed by Carbon60, similar to PageSpeedInsights butwith a nicer interface, so you can easily test the performance of your website and know which components are slowing it down.

 

gt metrix tips
Here are some tips that GTMetrix already gave you during the analysis: hire a good hosting and move the JS to the footer. You will see later how to do just that 😉

 

You can use GTMetrix without registration, but to change the location from which the loading speed is measured you must register for a free account.

The first thing you will see at the end of the diagnosis will be this series of parameters:

  • Fully Loaded Time: Full page load time. It should be at most around 2 or 3 seconds of charge (never more than 6s).
  • Total Page Size: Page size. It is recommended not to exceed 1Mb in weight, although the case can be reviewed according to the needs of your website.
  • Requests: Messages sent from the client to the server to request a resource. It must have less than 100 requests, although on large sites this may not be possible.
  • Time To First Byte or TTFB: This is the waiting time for the first byte of information to reach the client. It must be less than 200ms. This is the first piece of information that appears in the Waterfall tab.

After the diagnosis, GTmetrix scores your site according to its performance.

 

gtmetrix score
GTMetrix score for our website

In case of not giving a good score (below 60% in Pagespeed and Yslow), there are a lot of measures we can take to improve the loading speed. Here are some of them.

16 things you can do to optimize your WordPress loading time

If the GTmetrix score for your WordPress is not like ours… let’s fix it.

The following is a description of the most important improvements and changes that will speed up your website almost automatically.

#1 Upgrade your server’s PHP version

PHP is the programming language that runs WordPress. Like any programming framework, it receives periodic updates to improve its performance and security.

When there is a new PHP version you will probably see a warning in your WordPress console, and it is highly recommended to update when necessary. In return for such an upgrade, your website will be faster and more secure, as each new version of PHP is up to 3 times faster and more efficient than its previous versions.

Updates through the server interface

To see your PHP version in CPanel go to the CPanel console > Select PHP Version.

It will look something like this:

php cpanel version

Change the version accordingly.

In the case that your server works with another manager such as Plesk, look for the “Php” option in the administration options.

Check PHP version via FTP

If we do not have access to CPanel or Plesk, but we do have access to an FTP connection, we can find out the PHP version by following the steps below:

  • Open a notepad, paste the code you see below and save it under the name “info.php”:
<!--?php phpinfo(); ?-->
  • It is important that it is saved as “.php”, be careful that it is not “.php.txt”.
  • In the public_html folder of your WordPress, upload the info.php file you created.
  • Enter in the browser yourdomain.com/info.php and you will see the php version.
  • After verification, delete the info.php file

To upgrade your PHP version safely, you must:

  1. Create a backup copy of the website before the upgrade in case something doesn’t work or breaks with the upgrade. If so, you can easily restore the website.
  2. Install the penultimate version available, not the latest.

#2 HTTP protocol vs HTTP/2

HTTP or Hypertext Transfer Protocol, is the communication protocol that allows the transfer of information through files, usually HTML, on the internet.

HTTP/2 is the new version of HTTP, and it is better because:

  • optimizes the speed of communication
  • improvement of web positioning
  • prioritizes the load
  • consumes less bandwidth than classic HTTP

To check if your WordPress protocol is already in HTTP/2, go to: https://http2.pro/

In case it is not, send a ticket to your hosting service provider, commenting it is an important factor to make the web faster. If your hosting is of quality they should give you a hand with it.

But things don’t stay on HTTP/2, they scale up to HTTP/3, (although in most cases it’s paid).

In case of large customers and large WordPress, consider and evaluate its implementation on the web.

#3 Enable KeepAlive in WordPress

Keepalive is a message sent by one device to another to verify that the link between the two is working, or to prevent the link (connection) from breaking.

In order not to make you too dizzy, we will tell you that this speeds up the connections to your website because it takes advantage of those that are already open.

To enable it, access the .htaccess file and define the following directive:

  Header set Connection keep-alive  

#4 Increase the memory of your WordPress

Having more memory available for WordPress allows all your web resources to run smoothly. Normally, your hosting should provide you with at least 256 Megas, which is the minimum for WordPress use.

To increase it you must edit the wp-config.php file that will be in the public_html folder, and insert inside the following:

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

In the new versions of WordPress the memory limit is defined in the file: default-constants.php which is in the directory : /wp-includes

#5 Uninstall Unused Templates and Plugins

Your hard disk space and resource usage should be optimized as much as possible to avoid loading unneeded data. For that reason, one of the easiest tips to apply is to uninstall unused templates* and plugins, since they consume resources even if they do not perform any specific task.

*Note: always leave a backup template, as WordPress will use that one if it detects a problem with the one you have running.

#6 Optimize your .htaccess file

The .htaccess file, also known as HyperText Access, is a configuration file on your server.

The .htaccess file indicates everything that the user visiting your website can and cannot do. It also configures how the server behaves and how it optimizes the loading of the pages of your site or blog.

To optimize the .htaccess you only need to upload all the guidelines specified below to the file:


FileETag None

SetOutputFilter DEFLATE

Header unset ETag

#minifyCSS

  AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain

  AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml

  AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml application/atom+xml

  AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json

  AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf application/x-font-otf

  AddOutputFilterByType DEFLATE font/truetype font/opentype

  Header set Cache-Control "public".

  Header set Cache-Control "public".

  Header set Cache-Control "private".

  Header set Cache-Control "private, must-revalidate".

# compress text, html, javascript, css, xml:

AddOutputFilterByType DEFLATE text/plain

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/xml

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE application/xml

AddOutputFilterByType DEFLATE application/xhtml+xml

AddOutputFilterByType DEFLATE application/rss+xml

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/x-javascript

AddType x-font/otf .otf

AddType x-font/ttf .ttf

AddType x-font/eot .eot

AddType x-font/woff .woff

AddType image/x-icon .ico

AddType image/png .png

  mod_gzip_on Yes

  mod_gzip_dechunk Yes

  mod_gzip_item_include file .(html?|txt|css|js|php|pl)$

  mod_gzip_item_include handler ^cgi-script$

  mod_gzip_item_include mime ^text/.*

  mod_gzip_item_include mime ^application/x-javascript.*

  mod_gzip_item_exclude mime ^image/.*

  mod_gzip_item_exclude rspheader ^Content-Encoding: .*gzip.*

  ExpiresActive On

  ExpiresDefault "access plus 1 week".

  ExpiresByType image/x-icon "access plus 1 month".

  ExpiresByType image/jpeg "access plus 1 month".

  ExpiresByType image/png "access plus 1 month".

  ExpiresByType image/gif "access plus 1 month".

  ExpiresByType application/x-shockwave-flash "access plus 1 month".

  ExpiresByType text/css "access plus 4 month"

  ExpiresByType text/javascript "access plus 1 month".

  ExpiresByType application/javascript "access plus 1 month".

  ExpiresByType application/x-javascript "access plus 1 month".

  ExpiresByType text/html "access plus 1 week".

  ExpiresByType application/xhtml+xml "access plus 1 week".

# Disable ETags

  Header unset ETag

  Header set Connection keep-alive

FileETag None

############## CACHING-GZIP ############

ExpiresActive On

ExpiresDefault A2592000

ExpiresDefault A2592000

ExpiresDefault A2592000

ExpiresDefault A2592000

ExpiresDefault A2592000

  Header set Cache-Control "max-age=2592000".

  Header set Cache-Control "max-age=2592000".

  Header set Cache-Control "max-age=2592000".

  Header set Cache-Control "max-age=2592000".

  SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding

  RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding

  AddOutputFilterByType DEFLATE "application/atom+xml" \

  "application/javascript" \

  "application/json" \

  "application/ld+json" \

  "application/manifest+json" \

  "application/rdf+xml" "application/rdf+xml" "application/rdf+xml" "application/rdf+xml".

  "application/rss+xml".

  "application/schema+json" \

  "application/vnd.geo+json" \

  "application/vnd.ms-fontobject".

  "application/x-font-ttf" \

  "application/x-javascript" \

  "application/x-web-app-manifest+json" \

  "application/xhtml+xml".

  "application/xml".

  "font/eot".

  "font/opentype".

  "image/bmp".

  "image/svg+xml".

  "image/vnd.microsoft.icon" \

  "image/x-icon" \

  "text/cache-manifest".

  "text/css".

  "text/html".

  "text/javascript" \

  "text/plain".

  "text/vcard".

  "text/vnd.rim.location.xloc" \

  "text/vtt".

  "text/x-component".

  "text/x-cross-domain-policy".

  "text/xml"

  AddEncoding gzip svgz

#htaccessoptimization

And always remember to keep a backup copy of the old .htaccess, in case of server errors.

#7 Set up a CDN, such as CloudFlare’s.

A CDN is another ultimate solution to improve the speed (and security) of your WordPress website. And in CDN’s, Cloudflare takes the big prize: it is one of the most used and it is free.
A CDN accelerates your website by distributing content across a network of geographically distributed servers. CDN stands for Content Distribution Network and what it does is to create a copy of your website in the cloud. This reduces bandwidth costs and offers ultra-fast delivery of static and dynamic content.
To access Cloudfare you must:

  1. Register an account at: https://www.cloudflare.com/es-es/
  2. Register your domain.
  3. Change your domain’s DNS to CloudFlare’s.
  4. Go to Configuration > Recommended configuration and follow the steps below:

#8 Install WP Fastest Cache

WP Fastest Cache is one of several WordPress plugins designed to speed up the performance of your website. A caching system optimizes load times by creating and storing a static copy of the pages in the server’s memory, so that repeat visitors will visit these files on their second and subsequent visits. This means that the web will download faster in your browsers.
In other words, a web cache is nothing more than web documents stored locally to reduce bandwidth consumption, server load and download delay.
To enjoy all the benefits of Install WP Fastest Cache, you need to install the PRO version of this plugin. To configure it, simply replace it with the cache plugin you have and configure it so that it complements the Cloudflare CDN (and that there are no two overlapping caches).

#9 Configure Google Analytics JS locally

Google Analytics is a web analytics tool from Google that allows you to obtain information about traffic, audience and user behavior on your website.
To configure Google Analytics and optimize it for speed and SEO improvements, the WordPress CAOS (Complete Analytics Optimization Suite) plugin is the perfect tool:

CAOS | Host Google Analytics Locally

Host the Google Analytics JS locally, configure it as you see in the image below and you’re done!

#10 Set up a lazy-loading system

Lazy loading is a web performance improvement system. With lazy loading, the content of your page is loaded only when it is visible on the user’s screen and the loading of the object is delayed until the user scrolls to reach it.
There are WordPress plugins that allow you to configure deferred loading, one of them is Lazy Load for Videos:

https://es.wordpress.org/plugins/lazy-load-for-videos/

For websites that have embedded videos (YouTube, Vimeo, Twitter, etc.) select the option that replaces the video preview with an image saving the external URL script load.

#11 Remove WordPress widgets

WordPress comes by default with a number of widgets that contribute little or nothing to the operation and behavior of the web. The same goes for widgets that include themes and templates that you install in your backend.

If there are social media widgets, such as twitter or facebook, that do not do any favor to your website, it is best to remove them.

#12 Install WP Optimize

WP Optimize is an all-in-one WordPress plugin that aims to improve the performance of your website.

Clean your database, compress your images and cache your site.

WP-Optimize – Cache, Clean, Compress.

It is recommended for people who use WordPress a lot, or are relatively large.
To use it, simply install, view the tables to be cleaned and optimize (check the tables beforehand to make sure you don’t load anything that will be of interest to you later).

#13 Remove iframes (like Google Maps).

iFrame is the abbreviation of Inline Frame. Basically and not to complicate with technicalities, an iFrame is a web within a web.

It allows embedding documents, videos and interactive media within a page, such as Google Maps or YouTube videos. This means that with an iFrame you can display a secondary web page on your main page.

If you plan to improve the speed of the web, it is best to remove the Google Maps iframe where your business listing appears, that is, do not make an embed but simply put an image with a link to the corresponding Google My Business listing.

#14 Optimize WordPress images

Image optimization is the process of decreasing the size of your file by using a WordPress plugin or script. They improve loading times a lot and are easy to use.

There are options such as:

  • Shortpixel
  • Smush Image Compression and Optimization
  • Imsanity
  • TinyPNG

Just install them in your WordPress console and configure them with the step by step of each plugin.

Moreover, some of them not only compress the image, but even reduce its size automatically before compression.

#15 Configure script loading in WordPress footer

Loading JS files in the footer instead of in the header will improve the loading time speed and performance of our website, improving WPO scores and providing a better user experience.

To do this simply copy and paste the following guidelines into your WordPress functions.php file:

function footer_enqueue_scripts() {

remove_action('wp_head', 'wp_print_scripts');
remove_action('wp_head', 'wp_print_head_scripts', 9);
remove_action('wp_head', 'wp_enqueue_scripts', 1);
add_action('wp_footer', 'wp_print_scripts', 5);
add_action('wp_footer', 'wp_enqueue_scripts', 5);
add_action('wp_footer', 'wp_print_head_scripts', 5);

add_action('after_setup_theme', 'footer_enqueue_scripts');

}

#16 Hosting

Check that the server where you have hosted your website supports the requirements and needs of your project. In almost any hosting, you have a cpanel where you can see all the values of the hosting and see how much you are using of each one. If at any value you exceed 70% of the capacity, we would recommend you to upgrade or consider a change of server that better suits your needs.

If you need a suggestion on a good WordPress server, we recommend Webempresa(you can get the best price here). We have been working with them for more than 10 years for hundreds of projects and we have never had a major problem, and when we have had a problem they have solved it right away.

WordPress WPO Conclusion

As you have seen, the process of improving and optimizing the speed of your WordPress does not depend on a single thing and can be very variable depending on your project and its needs. Accelerating the loading of web pages made in WordPress can be done in different ways and each case can be different.

That is why we recommend doing trial and error, to see which points make the difference, and always do it with a backup copy, so that in case something goes wrong in the optimization process, you can go back without any problem.

Hire a WordPress WPO agency?

If you have come this far, and you don’t see it clearly, maybe what you need is the help of a professional or WPO consultant .

In Rodanet we have more than 10 years and hundreds of websites where we have been in all possible casuistry, which gives us a background to optimize the speed of WordPress in a much more agile way, and adapted to the needs of your website.

So if you prefer to hire a WordPress WPO agency, don’t hesitate to contact us and we’ll talk.

Sin asignación particular. Artículos redactados por el el equipo de Rodanet. Varias personas del equipo participan en crear los mejores artículos en cooperación y equipo 💪 Porque nos encanta trabajar en equipo 🔝

Leave a Reply

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

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Share

Last entries