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:
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.
WordPress isn’t trying to hide this information, so it shows up in several ordinary places:
<head> along the lines of <meta name="generator" content="WordPress ..." /> with the version in the content attribute./feed/ by default) include a generator element pointing at wordpress.org, with the version carried in the URL.readme.html in 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.wp-includes typically 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.
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.
// 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.
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.
?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.
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.
Here’s the ranking we’d stand behind, roughly in order of what it buys you.
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.
Not all WordPress security measures offer the same protection. Here’s where to focus your efforts.
Be cautious with plugins that promise to hide WordPress entirely and review their settings before enabling them.
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.
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.
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.
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.