/ Published in: PHP
By default, WordPress adds the? Ver = [version] parameter to the end of the address of all connected CSS and JavaScript files. The use of versioning adds a convenient mechanism for monitoring the state of the browser’s cache. After modifying the files, in order for the browser to automatically download the actual versions of CSS or JavaScript, the webmaster simply changes the numeric index ver for the connected file.
Despite the obvious advantages, this method has its drawbacks. One of the main reasons why developers refuse to use versions is that not all proxy servers and CDNs support file caching, at the end of which addresses the ver parameter is specified.
In order to remove ver from the connection string, you need to add the following code to the content of your theme's functions.php file:
Despite the obvious advantages, this method has its drawbacks. One of the main reasons why developers refuse to use versions is that not all proxy servers and CDNs support file caching, at the end of which addresses the ver parameter is specified.
In order to remove ver from the connection string, you need to add the following code to the content of your theme's functions.php file:
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function vc_remove_wp_ver_css_js( $src ) { $src = remove_query_arg( 'ver', $src ); return $src; } add_filter( 'style_loader_src', 'vc_remove_wp_ver_css_js', 9999 ); add_filter( 'script_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
URL: https://codebeer.ru/ubrat-versiyu-cssjs-fajlov-v-wordpress/