Query string prevents caching of static resources on proxy servers and CDNs which affects your SEO performance. WordPress by default includes a ver query string to its static resources, thus you need to add filter to remove this query strings.

To remove ver query string from static resources such as css and js, open your function.php file location at your theme folder and paste the following code:

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 );

That’s all folks. Hope that helps.
If you like this article please rate below.


Disclosure: Some of the links in this post are "affiliate links". We may receive a commission for purchases made through these links.

Leave a Reply


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