+1 408 758 5757

As many of you WordPress users know, there is no shortage of plugins claiming to speed up your site or boost your pagespeed score on Pingdom, GTMetrix, Google, etc. And for those of you who gave them a try, you’d likely agree that most didn’t actually work, or that they fixed one problem and created another.

But what if you could substantially boost your WordPress page speed score with as little effort as possible? All without wasting time messing around in W3 Total Cache, spending cash on a premium caching plugin, or setting up a CDN (without even knowing if it’ll work as you’d hoped)?

We spent some time tweaking our website and came up with some actionable tweaks to speed up your WordPress site, whether or not you’re a customer of FissionBlue managed WordPress hosting. We avoided using a CDN due to the upfront cost and mixed results, as well as the combining, minifying, or reordering of JavaScript & CSS due to the need for extensive testing. Here are the 3 easy ways to boost your WordPress page speed score that we came up with:

  • Image Optimization (Trimming Image File Sizes Without Impacting Quality)
  • Browser Caching (Your Browser Won’t Need to Download Everything Fresh Every Single Time)
  • Removing Query Strings From Static Resources
    (Browsers Can’t Cache Files with a “?” in the URL, i.e. www.yoursite.com/yourlogo.png?a=12345)

Image Optimization

Optimizing your site images is a great place to start, because even if you don’t see an immediate score improvement, you’ll significantly reduce the file size of your web pages (read: faster loading times). EWWW Image Optimizer is a free WordPress plugin that works out of the box to remove metadata and other junk data from image files. By default, it won’t mess with image quality or compression, however, you can tweak those settings if you’re an advanced user. A word of caution though: compressing your images can have detrimental results. Take this example: Google’s page speed insights tool offers a download link of “optimized” images and assets, though surprisingly they are often ruined due to overly aggressive compression by Google’s servers.

Remember: use your best judgement with image optimization recommendations. Even Google’s page speed insights tool isn’t gospel and must be taken with a grain of salt (as with all page speed testers).

Configure Browser Caching

Next up, we have browser caching. Now this one can be a little trickier, especially if you’re already using a caching plugin. Before tweaking this, turn off browser caching in any caching plugin so you don’t create conflicts. If your host uses Apache, you may add this snippet to the .htaccess file or the apache2 .conf file:

<IfModule mod_expires.c>
 ExpiresActive On
 ExpiresByType image/jpg "access 1 week"
 ExpiresByType image/jpeg "access 1 week"
 ExpiresByType image/gif "access 1 week"
 ExpiresByType image/png "access 1 week"
 ExpiresByType text/css "access 1 week"
 ExpiresByType application/pdf "access 1 week"
 ExpiresByType text/x-javascript "access 1 week"
 ExpiresByType application/x-shockwave-flash "access 1 week"
 ExpiresByType image/x-icon "access 1 week"
 ExpiresDefault "access 1 week"
</IfModule>

If you know your host uses Nginx or a dual config, you shouldn’t use the code above. Instead, ask your host to add this snippet to your nginx .conf file (not .htaccess)

location ~* \.(js|css|png|jpg|jpeg|gif|ico|mp4|webm)$ {
 expires 7d;
 add_header Cache-Control "public, no-transform";
 }
 gzip on;
 gzip_proxied any;
 gzip_min_length 1100;
 gzip_comp_level 1;
 gzip_types application/x-javascript application/javascript text/javascript text/css text/plain text/xml application/xml image/gif image/jpeg image/png image/x-icon image/bmp image/svg+xml application/x-httpd-php video/mp4 video/webm;
 gzip_vary on;

Notice how we’ve set everything to cache for 7 days/1 week. This is a good starting point in most cases, so your score doesn’t get marked down by the speed test tools. Once again, if any of this seems a little over the top or you’re not sure where to put the code, remember that your web host will know where to put it.

Remove Query Strings from Static Resources

Last, we need to remove query strings from static resources. This is so there’s nothing stopping our browsers from caching everything we need them to. Without this, the impact of the previous step will be significantly reduced. Though this last step can be solved through many means, we’ve found that the lightest, easiest method was to paste this PHP snippet into our Child Theme’s functions.php file. No plugin, no tweaking, no troubleshooting:

function _remove_query_string( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_query_string', 15, 1 );
add_filter( 'style_loader_src', '_remove_query_string', 15, 1 );

Note: Pasting the snippet above in a Parent Theme is not recommended whatsoever. Not only do you risk accidentally splitting existing code, but you’ll lose all your hard work if you update your theme. If you don’t know what a Child Theme is, spend a few minutes researching it. We’ll cover this in a later post, but for now just take our word for it.

So there you have it. If you invest 15 minutes of time to implement one or more of these changes, you’ll likely be in much better shape than you were before. You are more than welcome to reach out with questions or if you’re curious about switching over to FissionBlue hosting. We’ll do our best to help.

Share This