How to remove ver from js and css in WordPress ?

Remove the ver=date behind the JS and CSS in wordpress.

// Load in any own plugin
function juz_remove_wp_ver_css_js( $src ) {
    if ( strpos( $src, 'ver=' ) )
        $src = remove_query_arg( 'ver', $src );
    return $src;
}
add_filter( 'style_loader_src', 'juz_remove_wp_ver_css_js', 9999 );
add_filter( 'script_loader_src', 'juz_remove_wp_ver_css_js', 9999 );

Tags:

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.