Remove CSS and JS version parameter from WordPress - functions.php

PHOTO EMBED

Wed Aug 31 2022 21:22:50 GMT+0000 (UTC)

Saved by @satinbest #php

// Remove wp version param | css and js
// Example: style.css?ver=5.2.2  =>  style.css
function remove_wp_ver_css_js_code_paste( $src ) {
    if ( strpos( $src, 'ver=' ) )
        $src = remove_query_arg( 'ver', $src );
    return $src;
}
// for css style file urls
add_filter( 'style_loader_src', 'remove_wp_ver_css_js_code_paste', 9999 );
// for js script file urls
add_filter( 'script_loader_src', 'remove_wp_ver_css_js_code_paste', 9999 );
content_copyCOPY

Remove script/style version parameter - bloat

https://www.code-paste.com/remove-css-and-js-version-parameter-from-wordpress/