Quick Fix: Remove WordPress Version Number from Header Easily

Estimated reading time: 2 minutes

Last updated on May 26th, 2024 at 08:39 am

Imagine you’re at home, and you have a sign on your front door that says which year your lock was installed.

If it’s an old year, burglars might think it’s easy to break in. The same thing can happen with your WordPress site.

The version number of WordPress is like that sign on your door.

If it’s visible, hackers know exactly what they’re dealing with.

Removing the WordPress version number from your site’s header can make it harder for hackers to target you.

Hackers often look for sites running old versions of WordPress because they know there are security holes they can exploit.

Over 70% of WordPress installations are vulnerable to attacks because they are not up to date.

This is why hiding the version number can add an extra layer of security.

Remove WordPress Version Number from Header

hide wordPress version number from header

Add the following code to your theme’s functions.php file:

// Remove WordPress version number from header
remove_action(‘wp_head’, ‘wp_generator’);

How This Helps:

  1. Security: Hiding the WordPress version number can make it harder for hackers to exploit known vulnerabilities in specific versions of WordPress.
  2. Simplicity: This one-liner helps you maintain a cleaner site by removing unnecessary information from the header.

Steps to Add the Code

  1. Backup Your Site: Always backup your site before making changes to your theme files.
  2. Access functions.php:
    • Go to your WordPress dashboard.
    • Navigate to Appearance > Theme Editor.
    • Find and click on the functions.php file in the right-hand sidebar.
  3. Add the Code: Copy and paste the code snippet at the end of the functions.php file.
  4. Save Changes: Click the “Update File” button to save your changes.
Also Read  How To Motivate Yourself For Blogging - Tips, Ideas and Inspiration When You Are Demotivated

You can also use WP Code plugin to copy paste the above code.

Wrapping Up

Removing the WordPress version number from your site’s header is a smart way to improve your website’s security.

By hiding the version number, you make it harder for hackers to find and exploit weaknesses in your WordPress version.

This can be easily done by using this simple code.