Another easy speed BOOST for your Wordpress site

Issue #105

I’ve got another slightly geeky (but still easy) hack you can make to give your blog another speed boost…

Yesterday’s issue of The Daily talked about removing orphaned settings from your WP_OPTIONS table to speed up your site.

In there, I talked how I initially ran a speed test on my site using GTMetrix. This is a nice service because it actually allows you to compare some of the other more common site speed tests like PageSpeed and YSlow.

One of the common things you’ll see pop up on these tests is something called dynamic query strings. The message will be something like:

“Remove query strings from static resources”.

I know – nerdy! But, here’s what’s going on there…

A lot of Wordpress sites automatically insert query strings as a way to defeat caching and make the site load fresh each time. A query string is just something in the URL that contains some data after a “?” or “&” character. So, when your theme is pulling in various background files, it may have these query strings added – often with a version number or some other random thing.

So, as an example, if a plug-in were pulling in some kind of javascript file, it might use something like:
[YOURDOMAIN]/wp-content/plugins/[PLUGIN]/scripts.js?ver=2.5

That little “?ver=2.5” thing is the query string. And when you run a speed test on your site, it may show you a big honker list of these things on you site.

Here’s the problem…

Google really cares about site speed. And, those query strings help to defeat the very cache that will speed up your site! So, a way to optimize the speed of your Wordpress site is to REMOVE those query strings!

The good news is that it is pretty easy to do. I’ll show you a plug-in way to do it and a non-plugin way to do it (since I don’t like a long plug-in list if I can help it).

A number of plug-ins can take care of this for you.

Once is called, creatively, Remove Query Strings From Static Resources. I give them an A+ for naming creativity there. 😉 I mean, seriously.

If you use W3 Total Cache, it has an option for this built in called “Prevent caching of objects after settings change”. Uncheck that.

Speed Booster Pack does a number of things to help with speed, including removing query strings.

Lastly, you can check out the WP Performance Score Booster.

Now, let me show you how I did it without using any plug-in at all. It requires adding a few lines of code to the functions.php file of your theme. Those lines are:

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 );​

Just add that to your theme and problem solved without adding more plug-ins to the mix.

As always, back things up before making changes like this.

But, speedy blogs satisfy the Google gods. 😉 Solving this little issue of query strings helps move the needle your direction.

– David


David Risley

Here’s how I help people every day…


Make everything about managing your site simpler… by having me on your team to help make sure everything goes smoothly. By providing the very best tools, the best hosting and maintaining everything for you… I’ll take care of the mechanics so you can just focus on growth.


  • WP Speed Fix. Get the performance scores and core web vitals for your website fixed. Let me deal with the nerdy stuff. And let’s make your site purr like a kitten.
  • Technical Service: Going cross-eyed with WordPress plugins, theme changes, membership site setup, automations? Having difficulty making it all work? I can handle it. Ala carte work, as needed. No contracts.
  • Book A Call Anytime!. You can book either a strategy call (to talk strategy and planning) or an implementation session (where we’ll work on your site together).
  • ONEPass – All Access Pass To Every Course In The Library. For one small one-time purchase, you can unlock every course in the Blog Marketing Academy library. For life.
  • Get Some Anytime Credits. Use credits on your account to book development work or calls. Credits don’t expire, so services are flexible and “pay as you go”.

Did you like this issue? Consider sharing the opt-in page on social media to help it grow.
And feel free to forward it on to somebody you think will benefit from it.


The WP Edge is the official weekly newsletter of the Blog Marketing Academy.