GO BACK

Contact Us

5-E / 22 BP , 2nd Floor
Near BK Chowk
121001
Faridabad (Haryana), INDIA

Home Forums WordPress How to remove JS and css file version in wordpress? Reply To: How to remove JS and css file version in wordpress?

#1827 Reply

admin
Keymaster

Hi Vane,

Adding this into functions.php works a charm:

function remove_cssjs_ver( $src ) {
if( strpos( $src, ‘?ver=’ ) )
$src = remove_query_arg( ‘ver’, $src );
return $src;
}
add_filter( ‘style_loader_src’, ‘remove_cssjs_ver’, 10, 2 );
add_filter( ‘script_loader_src’, ‘remove_cssjs_ver’, 10, 2 );
Its removed the ?ver=xxx from both the js and css files

img