Another anti-hack hack is this handy security obscurity snippet that will hide the version of WordPress you’re using this hidden process makes it harder for hackers to exploit security issues and holes in older versions of WordPress.
By default WordPress leaves this option on your site for the sake of tracking and updating. Sometimes this option might be lead to a security leak on our WordPress site just in case if we are not running the most updated version of WordPress.
The code below will remove the version from the code source and also from the WordPress RSS feed. We just need to add this code snippet to your WordPress theme’s functions.php file.

Remove Publicly Displayed Version of WordPress code snippet:

// Remove the WP version for extra WordPress Security
function ns_remove_wp_version(){ 
 return ''; 
add_filter('the_generator', 'ns_remove_wp_version'); 

NOTE: The only way to ensure your site is secure is to maintain the site and up-to-date WordPress to the latest version, and also to have a strong username and password.

Read more here about WordPress codex “File Header”

Thank you for seeing my code snippet and fell free to share and comment 🙂 . Do you have a code snippet and you want to see it publish on my site ? I will be more than happy to do it please send me a message (here)