How to Remove WordPress Generator Meta Tag

WordPress adds a generator meta tag to your site’s header, and that tag shows which WordPress version you run. The snippet below removes the tag from the header for security reasons.
Instructions:
Add this code to your theme’s functions.php file or to a site-specific plugin:
remove_action(‘wp_head’, ‘wp_generator’);
Note: If this is your first time adding code snippets to WordPress, take a backup first and paste the snippet carefully, so you don’t accidentally break your site.