WordPress Optimization Guide

Overview

Many of our users run WordPress either as a CMS or blog platform. With a lot of great plugins available, it's easy to create a full-featured website with a lot of neat functionality. These plugins however, can insert additional CSS and JavaScript files into your header which can hurt your site's performance (and Page Speed and YSlow scores).

We've listed some plugins and written some recommendations for our WordPress users seeking optimization help.

After installing the plugins and doing some tweaks, here's how our own blog fared: Our Comparison report

How does your WordPress blog score?

Note: These plugins address mainly front-end optimization issues only. If your site still takes a long time to load, an improved server or back-end code optimizations is what will make a real difference. Read more about our WordPress Consulting Service.


***Optional First Step*** Download and activate GTmetrix for WordPress

Use this plugin to get a before snapshot of your WP performance.

Enter your GTmetrix API key
Enter your GTmetrix API key

Once you've installed it, enter your API key from your GTmetrix account in the Settings page (you must be registered to generate an API key).

Test your Front Page
Test your Front Page

After this is done, visit "Tests" and under the "Latest Front Page Score" module, click "Test your Front Page now" button.

Front Page Report Generated
Front Page Report Generated

A report will be generated with PageSpeed and YSlow grades for the front page of your WordPress site. This is your before performance.



Step 1) Download and activate W3 Total Cache

You'll notice a new section in your admin sidebar called "Performance."

a) On the sidebar, click on the "General Settings" sub-section.

Under "General," Check "Toggle all caching types on or off at once."

W3 Total Cache: Toggle All
W3 Total Cache: Check this option

Since W3 Total Cache will turn on all its caching features, there are a few that may not be applicable to you. The common ones are a CDN and the CloudFlare feature. Uncheck "Enable" on these features if you don't have them.

Under the Minify subsection, There is an option called Minify mode. Select the Auto option.

W3 Total Cache: Set Auto Mode for Minifying
W3 Total Cache: Set Auto Mode for Minifying

Click Save all settings.

Note: If you make any changes to your WordPress plugins, the W3 Total Cache plugin may ask you to Empty the Cache. This is done to make sure the plugin doesn't serve a cached version of any changed files.

b) On the sidebar, click on the Minify sub-section.

Under HTML & XML, check Enable in the HTML minify settings. You can also check the other options, but make sure to test your site to see if it breaks.

W3 Total Cache: Enable HTML & XML minification.
W3 Total Cache: Enable HTML & XML minification, and other options if you wish

c) On the sidebar, click on the Browser Cache sub-section.

Under General, Cascading Style Sheets & JavaScript, HTML, and Media & Other Files headings enable the following:

  • Set expires header
  • Set cache control header
  • Set entity tag (eTag)
W3 Total Cache: Enable Browser Cache Options
W3 Total Cache: Enable Browser Cache Options

Click Save all settings.


Step 2) Download and activate WP Smush.it

This plugin will optimize every image you upload henceforth since you activated it.

WP-Smush.it in the Media Library
You can re-smush images in your Media Library

There are no options for this plugin and nothing to set up!

In the newer version of WP Smush it, there is a Bulk Smush.it feature that can smush all of your uploaded images. It has worked for us on smaller media libraries and it is very convenient, however it is experimental (we've experienced some errors with it on larger media libraries). Have a look at the feedback forums if you are looking for support.

That's it! You're finished.


Step 3) Analyze your site

Analyze your site again (via GTmetrix.com or with our plugin) and see the difference in performance!


Summary

We did a lot of testing and experimentation to find the best solution for WordPress users. These basic plugins can really improve the performance of a WordPress blog. Take a look at the difference in our blog:

If you have a WordPress blog, slow or not, give these plugins a try and improve your user experience!


Need further help?

We're experienced with optimizing high-traffic WordPress platforms. From code-optimizations to managed hosting, we can help even the most demanding WordPress installs run faster and more stable. Read more about our WordPress Consulting service.

Plugin List

GTmetrix for WordPress (optional)
http://wordpress.org/extend/plugins/gtmetrix-for-wordpress/

We created this plugin to help you actively keep track of your WP install and send you alerts if your site falls below certain criteria. More on GTmetrix for WordPress

W3 Total Cache
http://wordpress.org/extend/plugins/w3-total-cache/

This plugin adds page caching onto our WordPress install which helps us with Page Speed's "Leverage Browser Caching" rule. It also has features to help with other recommendations, including enabling gzip compression, setting ETags, and even CDN settings (if you have one), to further tweak your performance.

WP Smush.it
http://wordpress.org/extend/plugins/wp-smushit/

This plugin runs every image you upload through Yahoo's Smush.it application. This will losslessly optimize every image and helps us with Page Speed's Optimize images recommendation.

Notes

Help! Something broke and I can't access my admin!

W3TC might not play well with other plugins. Typically, WordPress will disable a plugin if it encounters an error, but if you still can't access your admin, delete the suspect plugin from your plugin folder via FTP.

That should automatically disable and remove it from your install. Here's a link on other methods on how to disable all plugins from your WordPress install.

Smush.it doesn't work sometimes!

Smush.it is a Yahoo! product that is offered free for developers. Since it's quite popular, the service may not be available 100% of the time. If you encounter "temp dir" errors, that means smush.it is temporarily down at the moment. Try to resmush at a later time.

How to smush previously uploaded images

The newer version of WP Smush.it includes a bulk smush.it feature which worked well on our blogs with smaller media libraries. However, larger libraries might take a bit longer. The feature is experimental, so do be patient while the kinks are worked out.

Do you have a CDN?

W3 Total Cache has a CDN settings page for you to input your settings.

What happened to WP-Minify?

In past versions of W3 Total Cache, the minifier wasn't working too well for us which made us opt for WP-Minify to handle the job. However, the latest version of W3 Total Cache has an improved minifier that does the job rather well, which renders WP Minify's functionality redundant. WP-Minify is still a great plugin for those wanting to simply minify their HTML/CSS/JS files. We recommend it fully!

Contribute to this recommendation

Have an opinion, link, or other contribution to share regarding this recommendation? Share it with us and help make the web a faster place!