Remove WordPress version from source code

Removing the WordPress version from your the code may contribute to your website’s security. Some hackers use special robots to scan WordPress websites that haven’t been updated to the most recent version of WordPress.

That said if you don’t update your Website core on a regular basis hackers might exploit possible security holes in your outdated WordPress version.

It has been considered an important task by WordPress savvy developers to hide their WordPress version. doing so will make it difficult for robots to detect what version you are running.

Placing this little snippet of code in your functions.php file, will remove the WordPress version from your source code and will keep hackers away.

functions.php
// Hide Wordpress version from source code
function wph_hide_WP_version() {
  remove_action( 'wp_head', 'wp_generator' );
}
add_action( 'init', 'wph_hide_WP_version' );
How to remove #Wordpress version from your website's source code Click To Tweet