This article provides the required steps to remove query strings from static assets in WordPress websites.
Edit WordPress Theme functions.php File
Add the following code to the theme's functions.php file (located in /wp-content/themes/themename/ directory):
//remove query strings from static assets
function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );

👀 Choose SSD-powered VPS servers for increased speed, power, and security! Now 50% off- starting from only $3.19/mo.