How to remove ver from stylesheet URL? [duplicate]

You’re facing browser caching problem and it’s not because of ver. Every time you update your CSS or JS files you should hard refresh your browser using Ctrl + Shift + R or you can change the ver value. If the default ver is ver=1.0.0 then update the ver to ver=1.0.1. The point is, change the ver value to something you didn’t set before.

Most of the time the ver value comes from theme version. So you can try updating the Version parameter in style.css or find a theme version constant and update the value if there’s any.

And if you still need to remove ver then add the following code in your functions.php and ver will be removed automatically –

add_filter( 'style_loader_src', function( $src, $handle ) {
    // If you know the handle
    // if ( 'your-css-handle' === $handle ) {
    //  return remove_query_arg( 'ver', $src );
    // }
    // return $src;
    return remove_query_arg( 'ver', $src );
}, 10, 2 );

error code: 523