The Right Way to Remove WordPress Version Number

Do you want to remove the WordPress version number from your website?

Many believe that removing the WordPress version number from your website’s source code can prevent some common online attacks.

In this article, we’ll show you how to easily remove WordPress version number the right way.

Hiding WordPress version number from your website

Why Remove WordPress Version Number?

By default, WordPress leaves its footprints on your site for the sake of tracking. That is how we know that WordPress is the top website builder in the world.

WordPress version shown in source code by default

However, sometimes this footprint might be a security leak on your site if you are not running the most updated version of WordPress. It provides the hacker with useful information by telling them which version you are running.

We recommend using the latest version of WordPress on all your websites so you don’t have to worry about this. However, if for some reason you are running an older version of WordPress, then you should definitely follow this tutorial.

It is quite difficult to remove all traces of which WordPress version you are using on your website. A sophisticated attack may still be able to find that information.

However, it will prevent automatic scanners and other less sophisticated attempts from guessing your WordPress version.

That being said, let’s take a look at some ways to easily remove the version number from your WordPress website.

Method 1. Remove WordPress Version Information with Code (Recommended)

This method requires you to add code to your WordPress website. If you haven’t done this before, then see our guide on how to copy and paste code snippets in WordPress.

Now, many websites will recommend you to edit your theme’s header.php file and get rid of the following line of code:

1<meta name="generator"content="WordPress <?php bloginfo('version'); ?>"/>

Hosted with ❤️ by WPCode

1-click Use in WordPress

This method doesn’t work as a new theme update will automatically replace the old template with the new file.

Another commonly recommended, but inefficient method is to put this code in your theme’s functions.php or site-specific plugin:

1remove_action('wp_head', 'wp_generator');

Hosted with ❤️ by WPCode

1-click Use in WordPress

This will only remove the information from the WordPress header. The version number will still be visible in your website’s RSS feeds.

The right way to remove WordPress version information is by disabling the function responsible for displaying it.

In order for you to completely remove your WordPress version number from both your header file and RSS feeds, you will need to add the following code to a code snippets plugin.

1234functionwpbeginner_remove_version() {return'';}add_filter('the_generator', 'wpbeginner_remove_version');

Hosted with ❤️ by WPCode

1-click Use in WordPress

To make it even easier, you can use WPCode, the best code snippets plugin for WordPress.

WPCode has a built-in code library that has all of the most popular WordPress code snippets, including a snippet for removing the WordPress version number.

To get started, you need to install and activate the WPCode plugin. For step by step instructions, see our guide on how to install a WordPress plugin.

Once the plugin is activated, head to Code Snippets » Library from your WordPress dashboard.

Next, search for the ‘Remove WordPress Version Number’ snippet and click on the ‘Use snippet’ button.

Select the Remove WordPress Version Number snippet in WPCode

WPCode will then automatically add the code, add a title for the code, set the correct insertion method, and even add tags to help you organize it.

WPCode Remove WordPress Version code snippet

All you need to do is switch the toggle from ‘Inactive’ to ‘Active.’

Then, click the ‘Update’ button.

Switch the code snippet to Active and click Update in WPCode

Now the WordPress version number will be hidden from your site’s frontend and RSS feeds.

Method 2. Remove WordPress Version Number using Sucuri

All top WordPress security plugins offer an option in the settings to hide your WordPress version number.

However, we recommend using Sucuri because it automatically hides WordPress version information and offers other more advanced security features.

Simply install and activate the Sucuri plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, the plugin will automatically hide WordPress version information. You can verify it by visiting Sucuri Security » Settings and switching to the Hardening tab.

Sucuri WordPress version hardening

Can You Completely Hide WordPress Version?

WordPress may still add the version information in various other places throughout your website. For instance, it is included as the query string in source code for CSS and JS files.

WordPress version shown with CSS and JS files

Removing all instances of WordPress version information can be time-consuming, complicated, and may not always work.

From a security perspective, removing the obvious generator tags can protect you from some very common attacks.

However, if someone is determined to break into your website, then hiding your WordPress version number does little to stop this.

You need to implement a proper WordPress security setup in place to make your website more secure. This adds layers of security around your website making it harder to hack into.

Do you want to remove the WordPress version number from your website? Many believe that removing the WordPress version number from your website’s source code can prevent some common online attacks. In this article, we’ll show you how to easily remove WordPress version number the right way. Why Remove WordPress…

Do you want to remove the WordPress version number from your website? Many believe that removing the WordPress version number from your website’s source code can prevent some common online attacks. In this article, we’ll show you how to easily remove WordPress version number the right way. Why Remove WordPress…

Leave a Reply

Your email address will not be published. Required fields are marked *