Deprecated: Function create_function() is deprecated in /home2/blogwebhostingbu/public_html/wp-content/plugins/facebook-like-box-responsive/facebook-like-box.php on line 29
How Can I Make WordPress Faster? - WebHostingBuzz US Blog
Notice: Undefined variable: defaults in /home2/blogwebhostingbu/public_html/wp-content/plugins/fatpanda-facebook-comments/plugin.php on line 366
 

How Can I Make WordPress Faster?

Posted on 04 Aug 2014 by Adam

More than 22.8% of all websites on the Web use WordPress, with this number growing each day. We’re seeing more and more of our hosting clients installing WordPress, so spending time optimizing the platform is worthwhile.

There are of course a few common-sense ways to improve the speed of your WordPress website, such as making sure that if the majority of the visitors to your website are based in the US, you have a web server located in the US, rather than in the UK or Europe. Whilst this may be a fairly obvious speed improvement, there are also a few other things which you may not have considered.

Before making any changes, you may find it interesting to run and screenshot a few speed tests on sites such as Pingdom Tools, Google PageSpeed Insights, and GTMetrix. Then run the tests again after you’ve implemented the changes to see if there’s a noticeable improvement.

1.) Remove any unnecessary plugins

Have a quick look over the plugins you have installed on your WordPress site. How many of these do you actually use or need?

WordPress_plugin_list

There are many WordPress plugins which may seem to make life easier for you, but they can actually contribute to slower page load time.

For example, if you’ve got a plugin that inserts your Google Analytics code into the headers of your pages, why not just add the script directly into the theme template headers, and have one less plugin.

2.) Optimize/compress images

Image files are responsible for most of the disk space usage for a typical website, and are also major contributors to slow page load time.

There’s software available which can compress images with minimal or no visible reduction in quality, but get the best compression ratio, you should ideally use a different compression software for each type of image.

Compressing JPEG images

For JPEG images, I’d recommend JPEGmini. In the below example, JPEGmini managed to compress the image from 9.24MB to just 1.02MB! An incredible 9.1x reduction in filesize, with no visible reduction in quality!

NYC_taxi

Uncompressed JPEG (9.24MB)

NYC_taxi - compressed

Compressed JPEG (1.02MB)

Compressing PNG images

For PNG images, TinyPNG seems to be the best. In this example, it reduced the size of an image from 2.81MB to just 668KB! A 77% reduction in size!

Beautiful_Beach

Uncompressed PNG (2.81MB)

Beautiful_Beach - compressed

Compressed PNG (668KB)

With these reductions in filesize, image compression is something you should definitely spend time doing if you’re not doing it already.

3.) Minify HTML, CSS and JavaScript files

Since your website will likely have many of these files, these are the second contributor to slow page load speed; after images. There’s a method of ‘compacting’ your code called minifying, which removes the structuring of your code and converts it to a single block of text. As the unnecessary spacing and structuring is removed, the browser can process and display the page much quicker.

To minify your HTML, CSS and JavaScript files, simply paste the existing file into a site such as the HTML Minifier, hit ‘Minify’, then copy and paste the minified version into the original file. You should always keep a backup of the original ‘un-minified’ files though, so you can make any future edits with the data in structured form.

4.) Enable Gzip Compression

By compressing the website files during transit from the datacenter to the client, you can save much of the overhead needed to download a page. Gzip compression can usually be achieved by simply adding a block of code to your .htaccess file.

If your web server uses Apache, simply add the following lines of code to your .htaccess file (which can be found in the public_html folder of the website:

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

By enabling gzip compression on WebHostingBuzz.com, we achieved a file size reduction of 70%!

Gzip compression

5.) Enable Browser Caching

Whilst many elements of your WordPress website may change on a regular basis, it’s likely most elements (such as images) will stay the same. I’d recommend using a plugin such as W3 Total Cache, which offers caching of these ‘static’ resources, saving the user’s browser from having to load these from scratch each time he or she visits your site.

If you’d rather not install a plugin, you can simply add the following code to your .htaccess file for a similar result:

ExpiresActive On
ExpiresDefault "access plus 1 second"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/jpg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"
ExpiresByType text/html "access plus 2592000 seconds"

6.) Use a Content Delivery Network (CDN)

If you have a US-based web server and only receive visits from the US, you may think that you have the perfect setup. Whilst this setup might work fairly well, it is by no means perfect.

For example, you might think that by having a dedicated server in New York, you’re giving the best possible speeds to your US-based visitors. However, what if you have a visitor who is based in San Francisco?

Without a CDN, they’d have to download your website files from your server all the way from New York, which wouldn’t take forever, but could still be improved. If you instead made use of a CDN (from a company such as MaxCDN), they have a location in San Francisco which would be able to cache images and other website files in the same city as the user in this case.

MaxCDN USA San Francisco

If you’re unsure of where your website’s visitors are based, simply go to your Google Analytics account, click on the ‘Audience’ tab in the sidebar, click ‘Geo’, then ‘Location’. You’ll then see a list of countries from which you receive visitors, along with statistics for each country.

Google Analytics location

As you can see, whilst the location of your primary server is the most important consideration, Content Delivery Networks can help to increase page load speed further, by giving you a virtual presence in many locations across the world.

There are an endless number of CDN providers, which can make it a hard decision, but I’d recommend either CloudFlare or MaxCDN, since both integrate easily into WordPress installations using a plugin; either ‘CloudFlare‘ or by using the ‘W3 Total Cache‘ plugins respectively.

WebHostingBuzz Logo

© WebHostingBuzz USA LLC 2002 - 2024
WebHostingBuzz is a Registered Trademark.
All Rights Reserved.
WebHostingBuzz USA LLC, 850 Southbridge Street, Auburn, MA 01501, USA

1 (800) 252-1887

Payment Logos
  • Webmoney Verified
  • Webmoney Accepted

Sign up for our Newsletter

Scroll to Top