Created
June 21, 2017 14:13
-
-
Save lukecav/d747e9c5e8acdaeae0d75df08d3bd61d to your computer and use it in GitHub Desktop.
How to remove WordPress version parameter from JS and CSS files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.virendrachandak.com/techtalk/how-to-remove-wordpress-version-parameter-from-js-and-css-files/