Skip to content

Instantly share code, notes, and snippets.

@territutich
Last active April 22, 2016 15:51
Show Gist options
  • Save territutich/bdbc80caee339de8115c6504dc96bc38 to your computer and use it in GitHub Desktop.
Save territutich/bdbc80caee339de8115c6504dc96bc38 to your computer and use it in GitHub Desktop.
How to remove query strings from static resources https://www.netmagik.com/how-to-remove-query-strings-from-static-resources/
/* Remove Query Strings from static resources */
/* Add to functions.php */
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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment