Skip to content

Instantly share code, notes, and snippets.

@nutsandbolts
Created December 25, 2013 00:58
Show Gist options
  • Select an option

  • Save nutsandbolts/8119252 to your computer and use it in GitHub Desktop.

Select an option

Save nutsandbolts/8119252 to your computer and use it in GitHub Desktop.
Remove WP version from page source and enqueued scripts (goes in functions.php)
//* Remove WP version from enqueued scripts
function nabm_remove_version( $src ) {
if ( strpos( $src, 'ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'nabm_remove_version', 9999 );
add_filter( 'script_loader_src', 'nabm_remove_version', 9999 );
//* Remove WP version from page source
function nabm_remove_ver() {
return '';
}
add_filter('the_generator', 'nabm_remove_ver');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment