Three years ago, I build a wordpress website that was having web shopping store and event registrations combined with lot other features, so a hack of process behind website. But still was successful enough, having around 1000 business specific enquires or sales a day.
But in 2016, as business keep all analytics tracks, they saw a lot of new users are leaving website very quickly. Even without viewing home page. About 40% of users were leaving website in 4-8 sec without doing anything. Business approached me with detailed analytics reports and we concluded that slow loading is the culprit reason behind this. Website load speed was about 25 seconds. In past years visitors was bit patience about website loading but in recent 2 years the impatience is proved by analytics. Users don’t want to wait for webpage to load page for so long.
So we decided to speed up website load speed by hook or crook as business was having a big traffic loss due to slow website. I did research and practices to improve web load speed. A lot of suggestions were already online, and I started to test and practice. Some of the techniques I already tested I want to share with you:
I assume you already know how to check page load speed and are familiar with different load speed test tools.
- Be wise and use best hosting.
Hosting is critical part of website performance. There are certain questions always in mind when we are about to start hosting a new website; what hosting plan I should use? And what server location is best for me? Depending upon your purpose you can choose any plan among shared, VPS and dedicated servers.
Dedicated servers are most reliable and faster than any other servers; they don’t share resources and bandwidth on network.
| Web Host | Average Speed: | Average Downtime: | Visit |
| InMotion Hosting | 182 ms | 5 min | site |
| Host Gator | 188 ms | 6 min | |
| A2 Hosting | 155 ms | 7 min | |
| EHost | 198ms | 2mins | |
| WPEngine | 250ms | 3mins |
- Before installing any theme do some homework:
Over the years, there is a great evolution of marketplaces for theme and plugins with premium themes and are ready to use themes. All of the premium themes provide regular updates and maintenances while for free themes most of themes are not updated regularly; that’s why I would prefer using paid premium themes over free themes.
But there is an issue with premium themes that most of user’s faces and that is slow loading of pages; because of highly configurations and settings there is heavy lines of code behind the theme so every time you want to choose any theme please try to read comments and reviews online. You can easily find related reviews/comments on marketplace sites. Also premium themes can have extra features that are not required for you. So try to remove these features to minimize the code.
- Enable compression techniques
All modern browsers support GZIP compression and respond quickly to http requests. You can reduce the file size of a web files like PHP, HTML, CSS and JS with GZIP compression. After compression the compressed version of file is server to the browser request and then browser automatically serve default file to the user.
Images in fshot folder
Do You Know Gzip compression can reduce the file upto 90%, isn’t that cool
You can check Gzip compression enabling with .htaccess file(for apache servers) here below:
Image in content folder
After updating your .htaccess file you have to check whether it is implemented correctly and working on website. You can use GIDZipTest Tool, and check results.
- Leverage Caching
- Enable browser caching:
Browsers have to download all necessary files (HTML, CSS, JS and images etc) to load and display webpage every time. So large files and numbers of server requests mybe painful for website loading. Thus browser cache can reduce the load time for you by storing some of these required files on your local system while you land to website at very 1st time. At first time website loading speed will be same as without enabled cache, but for the revisit/navigate to other page it may change drastically.
How to leverage browser caching?
Enabling browser cache you need to set up caching parameters for your web files in the .htacess file. Find the .htaccess file in your root folder on your web hosting and add following lines of code to file:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access plus 1 year”
ExpiresByType image/jpeg “access plus 1 year”
ExpiresByType image/gif “access plus 1 year”
ExpiresByType image/png “access plus 1 year”
ExpiresByType text/css “access plus 1 1 year”
ExpiresByType application/pdf “access plus 1 year”
ExpiresByType text/x-javascript “access plus 1 year”
ExpiresByType application/x-shockwave-flash “access 1 year”
ExpiresByType image/x-icon “access plus 1 year”
ExpiresDefault “access plus 2 days”
</IfModule>
## EXPIRES CACHING ##
Be careful, if you are updating your files more frequently suppose once in month you can set expiry date to 1 month instead of a year. Setting too long expire time may serve old file to user.
- Install caching plug-in
In wordpress you can find and install any cache plugin to do caching work. Here are some top players:
- WP super cache
- W3 Total Cache
- WP Rocket
- WP Fastest Cache
Most of cache plug-in has compatibility issues with other plug-in or theme. Be careful while using such plugins and always keep full backup of your website and database.
- Try to limit the numbers of installed plugins:
Having too much plugin installed on your wordpress website is one of the common reasons. Most of the beginners to the wordpress always install plugins for easy features. This creates too much overhead for their webserver to handle and slows down website load speed.
Try to remove and delete unnecessary plugin and to check culprit plugin, you can selectively uninstall and check speed of website with speed check tools online. Alternatively you can install Plugin performance profiler plugin to check which plugin is slowing down webspeed.
- Optimize Data Base
Almost every website related information is stored in database and all information is well organized in the different tables. And with the time it accumulates a lot of information. And there may be lot of unnecessary data taking place and slowing down the performance of system to search and provide the requested information. Even when you change/remove the wordpress plugin the old plugin information is still stored in database. Therefore it’s not only taking up valuable space, but also slowing down website loading speed. To speed up wordpress website we need to remove all unnecessary information stored in different tables in database.
- Remove unnecessary comments and comments metadata.
- Clean all auto post data and post revisions in trash.
- Clean removed plugins data /tables
- Optimize images used on website:
Most of the multimedia files such as images, flash, videos etc are the heavy files and take a lot time to load. So there are two quick tricks to optimize images and speed up wordpress website:
- Apply lossless compression to all your images on web server.
- Try to lazy load for images.
Always try to use exact size from image properties of image doesn’t use scaled versions on your wordpress website.
- Minify and combine css and JS files
In this process we try to remove the unused and unnecessary css and Js code from files to reduce the size, without affecting the best outcome of browser.
Minifying CSS : We try to use single css file for all additional plugins without affecting main style sheet that is for your website theme. Before consolidating all plug-in css files make sure you get rid of all unnecessary plugin’s that your website doesn’t need. Than add all styles to single css file and add to header section with static link. This will reduce HTTP requests for different plugin styles to single HTTP request.
Similarly you can do for JS.
- Remove pingbacks, trackbacks and spam
Pingbacks are the automatic notifications from the other wordpress system as a comment in your moderation queue, if approved it will automatically add link with excerpt in the comment section on the post/page. And trackbacks are also same the only difference is that these notifications are sent from other software not from wordpress system.
Trackbacks and pingbacks are great features but spammers also get attracted to these features and that’s bigger problem. But fortunately, wordpress has solution for this problem as well. You can trun of pingbacks and truebacks in post settings.
- Replace php code with HTML wherever possible
Html code loads faster than PHP code so try to change php code to html wherever it is possible to change. For example you can change dynamic php code to static html code in header section.
- Perform routine maintenance of plugin’s and theme.
WordPress provide upgrades gradually and you need to update your theme and plugins for the new version of wordpress because there may be compatibility issues with theme/plugins with new upgrade and can cause loading delays. So keep maintaining and upgrading your theme and plugins. If you are using premium paid plugins and maintenance services than you just need to update the plugin’s and theme. And if you have some custom plugins used in your wordpress website than upgrade your plugins as per wordpress guidelines.