wordpress snippets

Remove Version Information from Scripts and Style Files in WordPress

Last modified: January 13, 2020

Cloudways

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

 

Show More

* This button will show the rest of the post and open up an offer from a vendor
Save 4 Later
Email liked links to yourself