I am trying to hide all version number on my WordPress site. Is it possible to remove the ver= version number from the stylesheet link in the wp-login.php page?
href='https://example.com/wp-admin/load-styles.php?c=0&dir=ltr&load%5B%5D=dashicons,buttons,forms,l10n,login&ver=4.9.8'
I already have the following in my functions.php:
remove_action('wp_head', 'wp_generator');
add_filter('the_generator', '__return_empty_string');
function shapeSpace_remove_version_scripts_styles($src) {
if (strpos($src, 'ver=')) {
$src = remove_query_arg('ver', $src);
}
return $src;
}
add_filter('style_loader_src', 'shapeSpace_remove_version_scripts_styles', 9999);
add_filter('script_loader_src', 'shapeSpace_remove_version_scripts_styles', 9999);
Can someone please explain why this has been down voted so that I can improve the question? It shouldn't matter why I want to do it, asking whether something is possible is still a valid question.
The OWASP Application Security FAQ specifically recommends hiding version numbers and so it is a legitimate security step towards increasing the security of an application.