Speed up your site by removing query strings

 

By removing query strings from your styles or scripts you can greatly improve your site performance.

Query strings are used in both javascript and style sheets, for example it is one of the methods that a plugin developer will use to render updates. Sometimes though the update is not visible until the cached file expires, and if you are using a CDN then that could take weeks or months.

By removing the query string it avoids you manually clearing your cache, and greatly improves your site performance and speed.

Simply navigate to your function.php and add this code at the bottom (don’t forget to do a backup of function.php, just in case)

 

function remaintenance_remove_query_strings( $src ){
    return remove_query_arg( 'ver', $src );
}
 
if ( !is_admin() ) {
    add_filter( 'style_loader_src', 'remaintenance_remove_query_strings', 15 );
    add_filter( 'script_loader_src', 'remaintenance_remove_query_strings', 15 );
}