Remove Publicly Displayed Version of WordPress is Another anti-hack

 In Admin, All, Security

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)

Recommended Posts

Start typing and press Enter to search

Let's work together

I'd love to work with you! Please fill out my project form to tell me more about your project/work. I reply to all enquiries within 48 hours.


  • January - Available
  • February - Available
  • March - Available


  • My day rate is £300.
  • I can provide a fixed price for your work.

EN - Header Enquiry Form

  • This form collects your name, email address and telephone number so that I can respond to the enquiry(ies) that you submit via this website. Please check my privacy policy for the full story on how I use, protect and manage your submitted data.