Skip to content

Instantly share code, notes, and snippets.

@bepatrickdavid
Created February 5, 2016 07:54
Show Gist options
  • Save bepatrickdavid/30b8ec65d6450fe03caf to your computer and use it in GitHub Desktop.
Save bepatrickdavid/30b8ec65d6450fe03caf to your computer and use it in GitHub Desktop.
htaccess: Remove query string from static resources
//wordpress function.php
function _remove_script_version( $src ){
$parts = explode( '?', $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