Your WordPress website needs to be fast. Amazon reported that speeding up their site load times by just 100 milliseconds meant a 1% boost in revenue. To the retail giant that will have been millions. Google have also confirmed that site load speeds are factored into SEO scores.
While you probably aren’t going to generate millions like Amazon, you will see better statistics in Google Analytics if you speed up your site.
Here are 12 fixes to improve your WordPress website loading times.
Find those Pesky Plugins
Try using a diagnostic plugin such as P3 to analyse the profile of all of your other plugins when it comes to page loading times. It will help you to stop any culprit which could be slowing down your website.
Social sharing plugins are often bloated and can be substituted for buttons in the source code of the theme instead.
Compress your Site Down
Much like ZIP files are much smaller, you can compress the pages of your website down and let a user’s browser unzip them using Gzip. It’s much quicker and can make the world of difference to page loading times.
You can install Gzip manually by adding this code to your site in the .htaccess file in your root directory.
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
Test if it has worked by using Check Gzip Compression.
Compress your Images
Most websites bandwidth is taken up with images. You can speed up your WordPress site by making sure that all of your image files are optimised for the web. There are also plugins which can help you with this such as WP Smush.it which compresses images as you upload them without losing any of the image quality. Even if you’ve already got lots of images, this plugin will retroactively go through and ensure that they are all optimised.
Try Browser Caching
Expires headers will tell a user’s browser whether to request files from the server or from the cache. This speeds up the site for visitors who have visited your site and therefore have a copy of the files stored in their cache on subsequent visits. This means the files don’t have to be downloaded from your server each time and reduces the number of HTTP requests.
You can use a plugin like WP Super Cache, but make sure that you follow the installation guide TO THE LETTER. You could try adding expires headers in your .htaccess file alternatively by adding the following code:
# configure mod_expires
# URL: http://httpd.apache.org/docs/2.2/mod/mod_expires.html
ExpiresDefault “access plus 1 seconds”
ExpiresByType image/x-icon “access plus 2692000 seconds”
ExpiresByType image/jpeg “access plus 2692000 seconds”
ExpiresByType image/png “access plus 2692000 seconds”
ExpiresByType image/gif “access plus 2692000 seconds”
ExpiresByType application/x-shockwave-flash “access plus 2692000 seconds”
ExpiresByType text/css “access plus 2692000 seconds”
ExpiresByType text/html “access plus 600 seconds”
ExpiresByType application/xhtml+xml “access plus 600 seconds”
# configure mod_headers
# URL: http://httpd.apache.org/docs/2.2/mod/mod_headers.html
Header set Cache-Control “max-age=2692000, public”
Header set Cache-Control “max-age=600, private, must-revalidate”
Header unset ETag
Header unset Last-Modified
Browser caching can be a bit contentious because if you do it wrong, you’ll actually end up making it worse.
Cleanup the Database
While the autosave feature in WordPress is great, it means that all of your drafts, revisions, unapproved comments and trashed content are stored in your database.
You can clear it all with a little plugin called WP-Optimize, which goes through your database to clear all this extraneous bumph.
A plugin like Better WordPress Minify can do this for you quickly and efficiently. This is our recommended plugin for this – others can be a little too aggressive with the whole adventure and can cause problems of their own.
Specify Image Dimensions and Character Sets
You can save a user’s browser loading time by specifying what size your images are. Character sets can also be specified in the HTTP response headers by adding them to the website’s head section.
No Pingbacks and Trackbacks
You can turn off pingbacks and trackbacks, which alert other blogs you link to, in the Discussion tab in Settings to speed up the site.
Using CSS spites can speed up your website by treating all your images as one big image which takes less time to load than lots of small ones.
You can use SpriteMe to turn all of your images into a sprite.
Enable Keep Alive
HTTP Keep Alive is the message that is sent between the web server and the user’s machine asking permission to download a file. By keeping this open, multiple files can be downloaded without repeated requests for permission, reducing bandwidth usage.
Header set Connection keep-alive
to your .htaccess file.
Use Static HTML not PHP
PHP uses up valuable server resources and if it isn’t saving time, you should replace it with static HTML across your site.
The more we more towards a mobile-dominated internet landscape, the faster your load times have to be. Get ahead of the crowd and try these tips for your WordPress website today.