Today, in the world of the internet, safeguarding the security of your website is extremely important. Agree?
One often overlooked yet critical aspect is hiding the WordPress version number. The version number directly indicates the software’s current state, making it a potential vulnerability for malicious attacks.
In this post, we’ll discuss how to hide WordPress version number and, thereby, improve the security of your website. So, without any further ado, let’s get started.
Table Of Contents
1 What is a WordPress Version Number?
WordPress versioning is a systematic way of assigning unique identifiers to different releases or updates of the WordPress software.
Each version number follows a specific format, usually in the form of X.X.X, where the numbers represent major, minor, and maintenance releases, respectively.

Major releases often include significant updates and new features, while minor releases address smaller improvements and bug fixes. Maintenance releases focus primarily on security patches and bug fixes.
This version number appears in several places:
- In the site’s HTML
<head>
section as a generator meta tag - Inside RSS feeds
- Appended to CSS and JavaScript file URLs as
ver=6.5.2
While it’s helpful for debugging or plugin/theme compatibility checks, it also exposes your site to unnecessary risks.
2 Why Remove the WordPress Version Number?
Hiding the WordPress version number becomes a necessity as it acts as a direct indicator of the software’s current state.
When your version number is visible in your site’s HTML source or RSS feeds, automated bots and hackers can:
- Match it to known exploits
- Launch targeted attacks on outdated core files, plugins, or themes
- Compromise your site before you’ve had a chance to update
By hiding this information, you can add an extra layer of defense, making it more challenging for potential attackers to pinpoint vulnerabilities.
An outdated WordPress version may also indicate that you have not updated your site, which means you will likely have plugins, themes, and server software that are outdated and can be exploited to access your site.
While keeping your WordPress site updated for the latest security patches and features is always recommended, hiding the version number can significantly prevent hackers from gaining access.
3 Methods to Hide WordPress Version Number
Let’s now discuss the methods for removing the WordPress version number.
3.1 Hide Your WordPress Version Number Using a Code
This method is straightforward—you can easily turn off the display of the WordPress version number by adding a code snippet to your site theme’s functions.php
file.
Note: Remember to back up your website before making any changes to the files, especially the theme’s functions.php file. This ensures an easy rollback if anything goes wrong during the process.
While you may find alternative codes online that suggest placing them in your site’s header.php or .htaccess, they might prove ineffective or become obsolete with WordPress or theme updates.
We’ve carefully created a code snippet to hide the WordPress version numbers in the header file, and RSS feeds to ensure reliability.
Simply copy and paste the following code into your site theme’s functions.php. You can add the code to your child theme’s functions.php
to prevent losing changes during theme updates.
function hide_wp_version() {
return '';
}
add_filter('the_generator', 'hide_wp_version');
Once you’ve added the code snippet, don’t forget to save your changes.

This code will eliminate the WordPress version number from appearing in your website’s HTML source code.
Benefits of Using Code:
- Lightweight: No need to install extra plugins
- Direct control: You know exactly what is being modified
- No dependency: Doesn’t rely on third-party tools that may stop working or be discontinued
3.2 Hide Your WordPress Version Number Using a Plugin
The quickest and simplest method to hide your WordPress version number involves utilizing security plugins like Sucuri Security.
To implement this method, install and activate the Sucuri plugin on your WordPress website. For detailed instructions, refer to our step-by-step guide on installing a WordPress plugin.
Once activated, the plugin will automatically hide your WordPress version information. You can confirm this by navigating to Sucuri Security → Hardening & Prevention. Next, scroll down to the Remove WordPress Version section, as shown below.

Benefits of Using a Plugin:
- Beginner-friendly: No coding knowledge required
- Quick setup: Configure with just a few clicks
- Centralized controls: Manage multiple security features in one place
4 Conclusion
Securing your WordPress website by hiding its version is essential to ensure extra security.
However, WordPress might still reveal the version in various places, such as CSS and JS files. Trying to hide it everywhere can be time-consuming and challenging, often without guaranteed success.
That’s why we suggest focusing on other security measures, such as using strong passwords and security plugins. This helps to safeguard your site beyond just hiding the version.
Have you been able to hide your WordPress site version using this guide? If so, let us know by Tweeting @rankmathseo.