Skip to content

Instantly share code, notes, and snippets.

@lukecav
Created June 21, 2017 14:13
Show Gist options
  • Save lukecav/d747e9c5e8acdaeae0d75df08d3bd61d to your computer and use it in GitHub Desktop.
Save lukecav/d747e9c5e8acdaeae0d75df08d3bd61d to your computer and use it in GitHub Desktop.
How to remove WordPress version parameter from JS and CSS files
// remove wp version param from any enqueued scripts
function vc_remove_wp_ver_css_js( $src ) {
if ( strpos( $src, 'ver=' . get_bloginfo( 'version' ) ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
add_filter( 'script_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
@khairuljf
Copy link

Good Job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment