wordpress snippets

Remove Version Information from Scripts and Style Files in WordPress

Last modified: August 27, 2018

Add the following to your functions.php file to remove your WordPress version from being a parameter on all of your script and style files.

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

 

Save 4 Later
Email these links to yourself