A fast website is probably one that loads in under 2 seconds by today’s standards, but it is amazing how many sites still take well over 8 seconds. It may not be possible to get all web sites under the magic 2 second mark, but even a slight improvement in speed can drive up conversion rates, increase the depth in which users explore your site and help to increase search traffic.
Google is now rightly factoring site speed into the rankings of websites and although at the minute a slow score as measured by Googlebot and an aggregate score from Google toolbar users is only said to be affecting 12% of websites – it is going to become a bigger ranking issue over time. Putting a side the end outcome of increasing rankings another SEO benefit of a fast loading site is that search engines are more likely to crawl deeper into your site, after all crawling billions of pages takes time so the engines do reward sites that can feed them pages quickly with deeper more frequent crawls.
The following are some quick easy fixes and some more involved tweaks in order to optimize a WordPress website for speed.
Upgrade to the latest version
It might seem obvious but many sites are still running a WordPress install that is 18 months out of date. Not only is this a security risk, but also the later versions of WordPress contain many optimizations for speed that were not in earlier versions.
[box type="info"]But remember backup everything before you upgrade – especially if you are upgrading from a really old version.[/box]
Upgrade those Plugins
In the same way you have upgraded the core CMS, it is worth keeping on top of all plugins as plugin authors are always learning new ways of making it run faster, be more compatible and importantly fixing those security holes.
Delete Plugins you don’t need
While you are looking at plugins, one of the easiest fixes is to remove any unwanted plugins that are currently activated in your WordPress install. Every plugin gets loaded and executed even if they are not in use.
Install W3 Total Cache
Remove unwanted PHP from templates
You may have bought an amazing theme from the likes of Woothemes.com, but when they made it they didn’t have you in mind and built it for any one to customize via a variety of backend menus. Once you have customized it to your site it is worth going into the templates and hard coding the choices that you have made. If you do this you can save many database calls on the following:
- Site Name
- Logo URL
- Site Description
- Navigation links
- Links to Social Media Profiles
- Variables that check if a featured box is to be show or not
Optimize your WordPress Database
Over time the MySQL database that powers a WordPress site vane benefit from being optimized. You can either do this via phpMyAdmin or an easy way is to use the Optimize plugin from Yoast.
Remember to deactivate it after use to avoid it being loaded for no reason!
Move the Database to a separate server
On very high traffic sites it’s worth looking at moving the database to its own dedicated server and using Memcached to reduce the number of queries that actually reach the database. WordPress can utilize Memcached easily via the awesome W3 Total Cache plugin.
Turn Off Post revisions
Every time you fix a spelling mistake within a post you are causing you database to bloat as WordPress stores extra versions of your post to enable you to restore to an older version. This extra data takes up space in the database and probably isn’t required and cause a database slow down. Also WordPress itself gets sluggish when you approach the 10K post mark so having a whole load of redundant revisions is getting you there quicker.
To disable post revisions add on of the following to wp-config.php
define(‘WP_POST_REVISIONS’, false); // to disables post revisions completely
define(‘WP_POST_REVISIONS’,2); // to only keep last 2 revisions
Social Media Buttons & Badges
They are great for driving traffic and helping your users to share content, but do you really need all of them?
If using video embed codes from YouTube or Vimeo make sure you use their latest iframe embed code as this will not slow your site down but instead load in parallel. In WordPress you cannot just paste an iframe so instead you need to use a plugin in order to enable the use of tags for that player, but there are plugins to make it work.
Avoid the http traffic jam
If an image is required more than once per page, you will need to ensure that the randomization is intelligent enough to assign both instances of the file the same host. If you don’t the different host name will make the browser think that it is a different file and then reload the image rather than pulling it from the cache.
Use a Content Delivery Network
Content Delivery Networks take a copy of a set of your files, such as images or videos and cache them on many servers around the world. The idea here is that the files are then available on a server only a few hops away from any user requesting them. For example a user trying to stream a video that is hosted on a London server, who lives in Hawaii will greatly benefit from the video being cached in Honolulu. CDNs used to be only for the biggest websites as the big CDNs like Limelight and Akamai are financially out of reach of a small website. Recently new CDNs have emerged that are aimed at the smaller website, these include MaxCDN and Amazon Cloudfront.
WordPress can easily be set up to serve static files from a CDN without making any code changes to the theme, you simply need to use the W3 Total Cache Plugin which has a CDN configuration page.
Use Asynchronous Google Analytics
The simplest way to utilize this on WordPress is via this Google Analytics WordPress plugin, which also has some great customization options.
Fast Web hosting
Hosting your site on an overcrowded web server at a cheap web host is going to kill all of the speed optimization work you have done so far. It really is not worth saving a few dollars to end up with a website that’s takes 10 seconds to load and crashes at the first sign of popularity. A good web host will not only have made the investment in expensive infrastructure, but they will also be monitoring load and adding new resources to meet demand.
There is a hosting company who specialize in hosting WordPress sites, they are incredibly fast and have invested millions in infrastructure and bespoke development in order to host and deliver the fasted hosting that you could want for a WordPress website. The company is called WPEngine and they have received investment from the owners of WordPress (Automattic), so they must be doing something right. Check out WPEngine and try their evaluation tool that can assess your current site and let you know how much they can speed it up.
Find out what else is slowing you down
Once you have completed these steps you should also test your site using the Yahoo! Yslow browser plugin or Google’s Page speed tool. Both of these tools will highlight any other issues with un-optimized CSS, too many http requests or other issues that you may not have considered.