How to Hide the WordPress Version Number

WordPress is the top Content Management System on the internet. In terms of market share, WordPress serves as the backbone of 60 percent of websites that use CMS. Because of this, WordPress is a prime target for hackers. One way of finding out the vulnerabilities of a website is through opening its source code. By default, WordPress displays its version number in the source code. A piece of code, however, can hide it. It may not stop relentless hackers from targeting your website, but you can at least stop them from knowing an important piece of information right away.

To hide the WordPress version number, add the following bits of code to the functions.php of the website:

// Hide WordPress version
function wp_remove_version() {
return '';
add_filter('the_generator', 'wp_remove_version');

If you want to go further than hiding the WordPress version number, you can install a plugin. Meta Generator and Version Info Remover strips the following information from the source code:

  • WordPress Meta Generator Tag
  • WPML (WordPress Multilingual Plugin) Meta Generator Tag
  • Slider Revolution Meta Generator Tag
  • Visual Composer / WPBakery Page Builder Meta Generator Tag
  • Version number from stylesheet
  • Version number from script
  • Yoast SEO comments
  • Google Analytics (MonsterInsights) comments