Skip to content

Instantly share code, notes, and snippets.

@edward-jimenez
Created January 2, 2017 04:18
Show Gist options
  • Save edward-jimenez/169dcca4f60922b43ef9a9d17d474585 to your computer and use it in GitHub Desktop.
Save edward-jimenez/169dcca4f60922b43ef9a9d17d474585 to your computer and use it in GitHub Desktop.
Removes the version of your css and javascript files to speed up performance
/*
Put the following function in your functions.php file to remove the query strings from css and javascript files
*/
function prefix_remove_script_and_style_version( $src ){
$ver = explode( '?ver', $src );
return $ver[0];
}
add_filter( 'script_loader_src', 'prefix_remove_script_and_style_version', 15, 1 );
add_filter( 'style_loader_src', 'prefix_remove_script_and_style_version', 15, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment