W3TC: Remove query strings from static resources quick tip

Just a quick tip for those who are using the famous W3TC (W3 Total Cache) caching plugin for WordPress. If you’re a Page-Load-Speed freak, and you’re checking how fast your blog loads day after day, then you might have noticed that your average speed grade in GTMetrix went down because of static resources factor. If your disappointed about the results of your speed test because of that one factor, then worry no more! You can remove those query strings easily in just one click.

Just go inside your WP admin, then click Performance > Browser Cache > Prevent caching of objects after settings change, then untick it. Just like the screenshot below:
Prevent caching of objects after settings change screenshot

Below are my GTMetrix results screenshot before removing the query strings. Notice that my grade is F in the query string factor, which is really disappointing and annoying:
with-query-strings

My Page Speed grade went up by 3% in just one click. Below is the GTMetrix results screenshot after removing the query strings:
without-query-strings

Try it yourself! If you’re not using a W3TC plugin, then adding this to your functions.php file might help:

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

More from Jehzlau Concepts

  • Weird WordPress Bug: latest post becomes a site name (1)
    I just found out about this today, and I thought it's a WordPress bug. It's actually an All In One SEO Pack bug. After upgrading to All In One SEO Pack version 2.3.11, my latest blog post […]
  • Achieve 99% in GTMetrix easily (65)
    Finally! I achieved the grade of double 99% in Gossamer Threads metrix using my old Jehzlau Concepts theme that I will make publicly available for download very soon. I'm still tweaking my […]
  • Just Upgraded to WordPress 2.6 and All I Can Say is “WOW!” (37)
    WordPress is undoubtedly the best blogging platform in the world! With the release of WordPress 2.6, it got even better. WordPress 2.6, code named Tyner, was released yesterday, July 15, […]
  • How to stop Blogspot spammers? (13)
    If you've turned off your comment moderation inside your blogger account, you won't be able to stop those nasty spammers. Well, it's just based on my experience. I don't know how to stop […]
  • Error: Download of swfupload_f9.swf returned response code 404 (3)
    If you encountered a WordPress Error with returned response code of 404 you've come to the right place. This is the common error that was encountered after upgrading to WordPress 2.6 and […]
  • Do We Need A Second Brain? (21)
    There are instances that our brain reaches its maximum capacity of memory intake. If we encountered this kind of phenomenon we intend to wish for a second brain, so that the excess data […]
  • Testing Calypso (23)
    Recently, Calypso was released by Automattic and everybody seems to love it. You can read more about Calypso in Matt's blog. According to what I've read, Calypso is really fast that's why […]
  • Goodbye Blogspot (34)
    My sincerest apologies to all of my subscribers for having no updates for the past few days. But now, I'm back! in a brand new, powerful, robust, and free blogging platform called […]

14 thoughts on “W3TC: Remove query strings from static resources quick tip

  1. Pingback: Nyok Nyok » Blog Archive » W3TC: Remove query strings from static resources quick tip

  2. Hi Kuya Jehz, happy new year po, siguro busy ka, wala ka po masyado update sa blog mo. kumusta po. Pwede mo po ba isali sa blogroll mo itong new blog ko? Salamat po.

Click to add emoticons

O_O :yeah: :wink: :wah: :twisted: :takot: :taka: :superlungkot: :silenced: :p :oops: :mrgreen: :lungkot: :lol: :lambot: :kagat: :ipit: :idea: :huh: :hilo: :gulat: :evil: :dila: :cry: :bleh: :blackeye: :asar: :aruy: :arrow: :anoyun: :akopa: := :-| :-x :-P :-D :-? :) :( 8)

Leave a Reply

Your email address will not be published. Required fields are marked *