Revelling your WordPress version number to all may make you an easy target for version-targeted attacks. So in this article, I am going to show you how to remove WordPress version number.
We can remove WordPress version number in 3 ways
1 By using a WordPress plugin
2
By editing “Generator Meta” Tag
3
By using version removal function
Note:- Do not make any changes in any of the functions if you are not sure of what you are doing.
By using a WordPress plugin
- Login into your wordpress dashboard and go to Plugins.
2. Click “
Add New“, search for “
WP-Hardening plugin” and click on
Install Now button.
3. Click
“Activate” to activate the plugin.
4. After activating the plugin, go to “
Security Fixers” tab and then look for “
Disable Information Disclosure & Remove Meta information”
5. Toggle the switch next to “
Hide version number” and that’s all.
If you are confident of your coding skills, you can remove the WordPress number manually from the generator meta tag:
1 Login into your control panel
2 Navigate to “File Manager”.
3 Select your domain and go to its Public_html directory
4 Go to “wp-content/themes” directory.
5 Find a file name
functions.php under your activated theme and add the following line of code at the bottom.
remove_action('wp_head', 'wp_generator')
By using version removal function
Alternatively, we can remove the WordPress version by using “
removal function”.
Follow the steps-1 to Steep-5 given above, edit your function.php file and paste the following code at the bottom.
function remove_version_info()
{
return '';
}
add_filter('the_generator', 'remove_version_info');