WordPress is generally a light web-application, but once you’ve set it up and the content grows, visitors might face a lag in loading speed of the site. The reduction in speed leads to lesser recurring visitors, even Google doubles the fact that with drop in loading speed, the ranking of a site drops too. You certainly don’t want that, so here’s an article with 7 steps that’ll give your site a speed boost .
A Good Web Hosting
Hosting, the place on internet where your WordPress software and the content is placed. Whenever a visitor visits your website, it is actually contacting your host server and downloading the files being a major factor in the speed issue. Usually, if you use share hosting the speed tends to reduce if some other site on the same server gets more visitors. However, most of the hosting giants have come with special packages for WordPress users, where the servers are optimized to do the best. They are a little expensive but faster and worth if you are running a professional/business WordPress website. A good hosting is the first check, if your website takes a delay in loading the page, you might want to change your host or upgrade the plan. Here’s the link for what I recommend.
The technique can drastically increase the loading speed and there are abundant plugins which perform the task of caching your dynamic content as static and thus reducing the server processing. The best/famous/recommended plug-in W3 total cache and it works like magic. With fairly simple installation and activation, the plug-in starts serving you right there by caching the dynamic content and presenting the visitors a much faster WordPress site.
Apart from W3TC several other plug-ins namely WP Super Cache, Quick Cache, Hyper Cache.. (and the list goes on) serve the same purpose. Apart from plug-ins, cache techniques are performed at browser and server level too, mostly applied on websites with a very huge traffic. Generally complex and effective in improving the speed upto 500 times. Plug-ins and server caching can be done together and works better. Varnish cache is such an application and provide a really good documentation of what actually it does at Server level.
If you’re site doesn’t reach a huge traffic, W3 Total Cache or any other plug-in will work like a charm and you’ll see a noticable difference. Also, there are a few tools online which will tell you if the cache application is working or not.
Content Delivery Network
The concept of Content Delivery Network (CDN) is fairly simple. Multiple copies of your wordpress files are saved on servers worldwide, apart from it securing your website from data loss works the best if you’ve visitors from different parts of the world. Usually paid service, a CDN delivers a visitor the files from the nearest located server, hence making the transfer faster.
I’ll recommend CloudFlare. Known for its top-notch service with data centres all over the world, CloudFlare is one of the best CDN. It also comes free, but business plans which include firewall and 100% uptime guarantee exceed $200 a month too.
Few other famous names include MaxCDN which starts from $9 a month, Azure, which is a Microsoft’s product and has 32 datacentres all over world, and Amazon CloudFront by Amazon.
Well, it’s the images that actually make a page heavy. Images weigh much more than textual content in your site and optimizing the images used improves the load speed greatly. If your WordPress website include multiple high quality images, you are certainly making your visitors suffer and you need those images fit for view your site. Plugins to the rescue, and my recommendation WP Smush. The most famous and recommended plugin which would reduce the image size without compromising the quality. Often ingenious approaches where users directly upload images/media from a camera lead to slower sites and this plugin works like a magic because you don’t have to choose images everytime, after activation, the plugin optimizes all the images you upload automatically. If your content demands high quality images I’ll recommend using a Content Delivery Network to speed things up.
Other Image optimization plugins I’ll mention are Optimus Image Optimizer and Short Pixel Image Optimizer and a lot more which perform the same task but the best one according to me is WP Smush.
If you’re wondering that I just claimed that the textual content didn’t weigh much, and still this topic gets a dedicated space, I’ll like to mention that this point is more of a waste removal awareness topic and contains more than 1 tip to enhance the speed.
WordPress doesn’t delete files, similar to Windows, WordPress has Trash where all the deleted items go and a check on it serves the speeding purpose. Although some tweaks in the wp-config.php file solves the issue of rechecking but I won’t recommend it for data loss purposes. Similarly, a plugin called Revision Control will help you clean out the revisions which you might not need after publishing a post.
Database optimization is equally important for clearing out the waste in your database. WP-optimized is recommended by me and several other WordPress experts out there for removing the spam from your data.
Well, I gave you a glimpse of server level optimization for enhancing the speed. There are several tweaks which can help your site drastically. Firstly, I’ll recommend you to enable GZIP compression, which views a compressed version of your site which is smaller and takes lesser time to load and content or quality remains the same.
Placing the following code in your .htaccess will enable GZIP compression, if it doesn’t work, other simpler methods are listed too.
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_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
You can enable it from cPanel, most of the hosting providers provide the option, or can use plugins like W3 Total Cache to do that for you. Ofcourse, increasing the RAM and a better processor also does the job but arduous task if you’ve already bought the hosting. I’ve already mentioned Varnish cache which works best if combined with W3TC, and also you can install PHP accelerators in your servers which speed up the back-end functioning. PHP is generally slower than plain HTML, minimizing and customizing your WordPresss’ PHP code and going static wherever possible will give your site a definite boost.
If you’re getting loads of traffic, I’ll even suggest changing your web-server from Apache to Nginx. A web-server similar to Apache but proven better in case of handling large number of visitors. Using FastCGI process manager really give a quicker functioning server. Apache is native PHP code runner and is faster if the code contains PHP only, but its proven many times that NginX is better for the functioning of a full website which includes CSS, JS and HTML. Well, I’ll not say better but faster for sure. There are various comparisons available for the both, as far as making WordPress is concerned NginX is my word.
Even though your web hosting server claims to have a top-notch antivirus, a malicious code can still enter your wordpress code. I’m talking about an adopting an attacker’s code and running it everytime someone opens your page which obviously benefits the attacker. Always be careful before installing a third-party plugin and never go for nulled templates. If you see a sudden drop in the speed, there are chances for a malware or a bug causing WordPress to run anomaly.
GTMetrix is another great service which comes in a paid and a free version that analysis performance and speed of your site.
You can view the impact of changes in your website and either go with it or choose to undo the change if the affect is adverse, which is quite useful in the optimization process.
I’d just mention the must do’s and don’t here quickly. Go for a nice theme, by nice I mean not too heavy, not to dull. Your site begins with the theme you choose, if its fancy but slow, it won’t impress Google and hence, visitors. Use a caching plugin and a CDN, go for free ones if you don’t have generally heavy media content. Cut down on useless plugins, though wordpress can handle many plugins but I never use more than 10 plugins for a WordPress installation including the ones for improving the speed. Keep it clean and simple and you’ll see your site work smooth and fast.