Skip to content

Instantly share code, notes, and snippets.

@schilke
Last active Aug 29, 2015
Embed
What would you like to do?
Remove query strings
<?php
// don't copy above line when copying and pasting into your functions.php
// Remove WP version number from js and css files.
// more exact function, removes also "&"
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) || strpos( $src, '&ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 15, 1 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 15, 1 );
// don't copy below line when copying and pasting into your functions.php
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment