I learned about WordPress version being visible to everyone the hard way when a security expert pointed out a glaring vulnerability on my website.
He showed me how to view my site’s source code and there it was, the exact WordPress version number displayed for anyone to see. At first, I didn’t think it was a big deal. After all, WordPress is open-source software, so why would hide the version matter?
But then he explained how hackers use this information. They scan websites looking for specific WordPress versions, then cross-reference that data with known security vulnerabilities to launch targeted attacks.
In this guide, I’ll show you how to properly remove your WordPress version number.
Why You Need to Remove Your WordPress Version Number?
Your WordPress version number is like a sign for hackers. Every time someone visits your website, they can right-click, view the Page Source, and instantly see which version of WordPress you’re running.

Here’s what makes this dangerous: WordPress vulnerabilities are publicly documented. For example, when security researchers or developers discover a flaw in WordPress 6.2, that information gets published in security databases that anyone can access.
Hackers have automated tools that scan thousands of websites daily, looking for version numbers. Once they find a site running an outdated version, they can immediately look up known exploits for that specific release.
I’ve seen websites get compromised within hours of a new vulnerability being announced. The attackers simply searched for sites running the vulnerable version and launched their attacks. They can steal sensitive information, lock you outside from the website for ransom, or bring down your site with DDoS attacks.
While hiding your version number isn’t a complete security solution, it does remove some of the threat. Attackers typically go after the easiest targets first, and a site that doesn’t broadcast its version information requires more effort to assess.
This extra layer of security forces hackers to work harder to identify your site’s potential weaknesses. Most will simply move on to easier targets that openly display their version information.
That said, let’s look at an easy way to hide WordPress version number from the page source.
Remove WordPress Version Number
Removing your WordPress version number might sound technical, but it’s actually straightforward when you use the right approach. And the best way to hide it is by using WPCode.
WPCode is the best WordPress code snippets plugin that lets you add custom code to your site without editing your theme files directly. This means your changes won’t disappear when you update your theme, and you won’t accidentally break your site with a coding mistake.
Plus, it offers a snippet library that’s verified by experts. This allows you to add additional features and functionality to your site in just a few clicks. Besides that, you can easily manage your PHP, HTML, CSS, JavaScript, and other snippets in a single place.
Note: I’ll use the WPCode Lite version, which is available for free and includes the snippet for removing the welcome screen. However, if you want more advanced features like code revisions and AI snippet generator, then I highly recommend upgrading to WPCode Pro.
With that, let’s look at how you can hide WordPress version number in page source step by step.
Step 1: Install and Activate WPCode Plugin
First, you need to install the WPCode plugin on your WordPress site.
Simply head over to your WordPress dashboard and navigate to the Plugins » Add New page. In the search box, go ahead and type ‘WPCode’ and look for the plugin.

Next, you can click the ‘Install Now’ button and then activate the plugin once the installation completes. If you need help, then please see this guide on how to install a WordPress plugin.
After activation, the plugin is ready to add a custom code to remove the WordPress version number.
Step 2: Add a Custom Snippet to Remove WordPress Version Number
Now that WPCode is installed, let’s create a new code snippet to remove your WordPress version number. The best part is that WPCode offers a pre-written snippet in its library, so you don’t have to write the code yourself or hire a developer.
First, you’ll need to navigate to Code Snippets » Add New from your WordPress dashboard.
From here, you can navigate to the ‘Remove WordPress Version Number’ snippet or use the search box to find the snippet. After that, simply click the ‘Use snippet’ button.

On the next screen, you will see the Code Editor with the snippet already loaded.
You don’t have to make any changes to the snippet and use it as is on your website.

Next, you can scroll down to the ‘Insertion’ section and see where the snippet will be inserted.
What makes WPCode special is that it will also configure the insertion method for the snippet. For instance, it will ‘Auto Insert’ the code and run it everywhere on your site.

Now, you can scroll back to the top and click the toggle to make the snippet Active.
Once that’s done, go ahead and click the ‘Update’ button.

Step 4: Test the Custom Code Snippet
Now, it’s time to verify that your code is working properly. The easiest way to check is by viewing your website’s source code.
Simply open your website in a new browser tab, then right-click anywhere on the page and select ‘View Page Source’ from the menu. You can also use the keyboard shortcut Ctrl+U (or Cmd+U on Mac).

After that, you will need to look for any lines containing ‘WordPress’ or version numbers.
Before adding the code, you would typically see something like <meta name="generator" content="WordPress 6.8.1" />
in the source code. If your code is working correctly, then this line should no longer appear.
For example, I tried searching for the WordPress version in the source code on my demo website and couldn’t find after activating the code snippet in WPCode.

That’s it! You’ve successfully removed the WordPress version number.
FAQs About Hiding WordPress Version Number
1. Is it safe to remove my WordPress version number?
Yes, removing your WordPress version number is completely safe and won’t affect your website’s functionality. The version number is primarily used for informational purposes, and removing it actually improves your site’s security posture.
2. Will removing the version number break my WordPress updates?
No, hiding your version number won’t interfere with WordPress updates at all. The update system works independently of the publicly displayed version information. Your site will continue to receive and install updates normally through the WordPress admin dashboard.
3. Can I use a custom code in my theme’s functions.php file instead?
While you technically could add a code to your theme’s functions.php file, I don’t recommend it. When you update your theme, you’ll lose all your custom code. Using WPCode keeps your snippets safe and organized in one place.
I hope this article helped you learn how to remove WordPress version number. You may also need to see our guide on how to remove the Welcome Panel in WordPress dashboard and how to enable maintenance mode in WordPress.
If you need help, then feel free to leave a comment below. And don’t forget to follow us on X (formerly known as Twitter) and subscribe to our newsletter for all the latest updates.