November 8, 2018
Remove ?Ver Querystring Parameter From Static Resources with WordPress
The following code example will remove all “?ver=” querystring parameters from static resources such as JS or CSS files, and may cause you issues with caching those.
Just place it in your theme’s functions.php and it’ll do:
function remove_ver_css_js( $src ) { if ( strpos( $src, 'ver=' ) ) $src = remove_query_arg( 'ver', $src ); return $src; } add_filter( 'style_loader_src', 'remove_ver_css_js', 9999 ); add_filter( 'script_loader_src', 'remove_ver_css_js', 9999 );