Plenty of hardening checklists put “hide your WordPress version” near the top, usually a line or two after “use a strong password.” It takes five minutes, and it feels like progress.
It’s also one of the smallest wins available to you. In this post we’ll look at where WordPress publishes its version, how to remove those signals if you want to, and why removing them doesn’t stop the scanning traffic that actually reaches your site.
Contents:
- What does “security through obscurity” actually mean?
- Where does WordPress expose its version number?
- How do you remove the WordPress version number?
- Why hiding the version doesn’t stop attacks
- What to do instead
- A verdict checklist: worthwhile, fine, and pointless
- Is security through obscurity ever effective?
- Frequently asked questions
What does “security through obscurity” actually mean?
Security through obscurity means protecting something by keeping details about it secret: which version you run, what your folder names are, where your login page lives. Hardening is the other thing: making the site hard to attack once those details are known.
Used on its own, it’s a weak strategy, because secrets about a public website leak constantly. Your pages and headers describe your setup to anyone who asks politely over HTTP. So do your asset URLs and error responses. Used as one thin layer on top of controls that genuinely work, obscurity is harmless and occasionally helpful.
That’s the distinction we’d ask you to hold onto. Hiding the version is fine. Hiding the version instead of updating is the part that gets sites hacked, and it happens more than you’d think. An owner removes the generator tag and the scan report goes quiet. The outdated plugin that was the actual problem sits there for another eight months.
If the layered thinking behind this is new to you, our piece on defense in depth covers how the layers are meant to stack up.
Where does WordPress expose its version number?
WordPress isn’t trying to hide this information, so it shows up in several ordinary places:
- The generator meta tag carries it. View the source of your homepage and you’ll find a line in the
<head>along the lines of<meta name="generator" content="WordPress ..." />with the version in the content attribute. - Your RSS and Atom feeds (
/feed/by default) include ageneratorelement pointing at wordpress.org, with the version carried in the URL. - Core ships
readme.htmlin the web root, and it’s readable by anyone who requests it. On many installs it’s the single most direct way to read the version off a site. - Query strings on core scripts and styles. Enqueued assets from
wp-includestypically carry a?ver=parameter that matches the core version. Plugin and theme assets carry their own versions the same way.
There are quieter signals too, like the markup of the login page, which REST API routes answer, which core files exist at all, etc. We’ll come back to those, because they’re the reason this exercise has a ceiling.
How do you remove the WordPress version number?
Put the code in a child theme’s functions.php or, better, a small site-specific plugin so it survives a theme change. Don’t install a plugin whose only job is this.
1. Drop the generator tag and the generator string.
// Remove the generator meta tag from the page head. remove_action( 'wp_head', 'wp_generator' ); // Empty the generator string everywhere else it is output, including feeds. add_filter( 'the_generator', '__return_empty_string' );
The the_generator filter is the one people forget. Remove only the wp_head action and your feeds keep announcing the version happily.
2. Delete or block readme.html.
Deleting it works, but core updates can put it back, so a server rule is more durable. On Apache, a block in .htaccess does it:
<Files "readme.html"> Require all denied </Files>
On nginx the equivalent is a location rule that returns 404 for that path. Check the syntax against your host’s documentation — control panels sometimes manage these files for you.
3. Think twice about the ?ver= strings.
You can strip them with a filter on script_loader_src and style_loader_src, using remove_query_arg( 'ver', $src ). The catch is that browsers and CDNs use that parameter to know when a file changed. Strip it and a visitor can keep a stale copy of your CSS after an update, which shows up as a broken-looking layout for some people and not others. If you remove the version, replace it with something that changes when the file does — a hash or a modification timestamp. Otherwise leave it alone.
Why hiding the version doesn’t stop attacks
The assumption buried in most “hide your version” advice is that an attacker needs to know your version before they can do anything. They don’t, and there are three reasons.
First, core is fingerprintable without asking. Every WordPress release ships a known set of files with known contents, so checking which files exist and what a few of them contain narrows a site to a small range of versions. Behavior gives it away as well — which endpoints respond, what the login page markup looks like, which assets are bundled. A tool built for this reaches a confident answer in a handful of requests.
Second, most of the traffic hitting your site never performs detection at all. Mass scanning works by requesting known vulnerable paths directly: the admin-ajax action a particular plugin version mishandles, the unauthenticated REST route in some page builder, the upload handler in an abandoned gallery plugin. Those requests arrive whether or not you have the plugin, and whether or not your version is visible. Dedicated WordPress vulnerability scanners work the same way, enumerating plugins and themes by probing for their files, then matching what they find against a vulnerability database.
Third, core isn’t usually the weak point. WordPress applies minor core releases automatically on most installs, so the version you’re reporting is often current anyway. The outdated things tend to be plugins and themes, and each of those broadcasts its own version in asset URLs and readme files that your generator-tag removal never touched.
What to do instead
Here’s the ranking we’d stand behind, roughly in order of what it buys you.
- Apply updates quickly to core, plugins, and themes. Most of the compromises we clean up trace back to a known vulnerability in a component that had a patch available. Our post on why delaying WordPress updates increases security risks goes into the window you’re leaving open.
- Delete components you don’t use, and replace the ones nobody maintains. A deactivated plugin still sits on disk and can still be reachable. Abandoned code never gets a patch, and software from unofficial sources can arrive with problems already installed — see the security risks of using nulled WordPress plugins.
- Restrict who can reach sensitive areas. Start with multi-factor authentication on admin accounts. Then rate limiting on login, and fewer administrators than you currently have.
- Put a firewall in front of the site. A web application firewall can block requests matching known exploit patterns before they reach PHP, which covers you during the gap between a vulnerability becoming public and your update landing.
- Watch the site for change. File integrity monitoring and an activity log tell you when something was added or edited that you didn’t add or edit.
Say a scanner looks at your site today and reports two findings. One is the core version, read from your generator tag. The other is an outdated plugin with a publicly documented vulnerability. You remove the generator tag and run it again. Now it reports one finding, the plugin. The attack that would have worked this morning still works this afternoon. That’s the whole shape of the trade.
What’s worth doing and what to skip
Not all WordPress security measures offer the same protection. Here’s where to focus your efforts.
- Worth prioritizing: Keep WordPress, plugins, and themes updated, and remove anything unused or abandoned. Enable multi-factor authentication for administrators, use a web application firewall, monitor file changes and user activity, and maintain tested off-site backups.
- Helpful but limited: Remove WordPress version information from generator tags, restrict access to readme.html, disable directory listing, and prevent PHP errors or debug information from appearing publicly. Avoid exposing which accounts have administrator privileges.
- Generally not worth it: Removing version parameters from assets without proper cache busting, renaming core WordPress directories, or relying on a hidden login URL instead of rate limiting and MFA. These changes add complexity without addressing the underlying security risks.
Be cautious with plugins that promise to hide WordPress entirely and review their settings before enabling them.
Is security through obscurity ever effective?
Security through obscurity can make certain details about your WordPress site harder to find, but it offers limited protection against automated attacks. Hiding your WordPress version or changing familiar paths won’t prevent attackers from exploiting known vulnerabilities.
Rather than relying on obscurity, focus on keeping WordPress updated, removing unused plugins and themes, and monitoring for suspicious activity.
Sucuri’s website security platform helps strengthen these efforts with a web application firewall, malware scanning, file integrity monitoring, and security alerts. Together, these protections help detect threats, block malicious traffic, and identify potential compromises.
Hiding your WordPress version is fine as an additional precaution, but it shouldn’t take priority over security measures that address real vulnerabilities.
Frequently asked questions
Does hiding the WordPress version stop hackers?
No. Attack tooling fingerprints WordPress from which core files exist, how endpoints respond, and what the login page looks like. Most automated traffic skips detection altogether and requests known vulnerable plugin and theme paths directly. Those requests arrive whether your version is visible or not.
How can I see which WordPress version a site is running?
View the page source and look for the generator meta tag, check the RSS feed for a generator element, request readme.html in the site root, or read the ?ver= parameter on core scripts and styles. Vulnerability scanners combine these signals with file checks for a more reliable answer.
How do I remove the WordPress version number safely?
Add remove_action('wp_head','wp_generator') and a filter on the_generator returning an empty string, placed in a site-specific plugin or child theme. Delete readme.html or deny it at the web server. Leave ?ver= query strings alone unless you replace them with a value that changes when the file changes.








