Remove Query Strings From Static Resources


My site is built on a WordPress theme. In all of the page load speed tests like Pingdom, Google, Gtmetrix, etc, Im getting low scores for having so many Query Strings on Static Resources. I have tried a number of plugins designed for removal, but they don’t help enough. I tried adding this to my functions.php file but it didn’t help either:

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

Is there a way to manually remove or modify these strings?


Can you show some examples of those URLs with query strings?

They are added to the images I upload by WordPress at the end after the .png

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.