Last active
December 26, 2020 17:37
-
-
Save mhajder/efeb3537b5e77f87e036588176615050 to your computer and use it in GitHub Desktop.
Hide WP version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hide the meta tag generator from head and rss | |
function disable_version() { | |
return ''; | |
} | |
add_filter('the_generator','disable_version'); | |
remove_action('wp_head', 'wp_generator'); | |
// hide the meta tag generator from scripts and styles | |
function remove_version_from_style_js( $src ) { | |
if ( strpos( $src, 'ver=' . get_bloginfo( 'version' ) ) ) | |
$src = remove_query_arg( 'ver', $src ); | |
return $src; | |
} | |
add_filter( 'style_loader_src', 'remove_version_from_style_js'); | |
add_filter( 'script_loader_src', 'remove_version_from_style_js'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment