Hide the WordPress and WooCommerce version number
Remove the version number from WordPress and WooCommerce output, the places it still leaks, and why updating matters more than hiding.
At a glance
By default WordPress prints its version in your page source and WooCommerce adds its own. Remove them with two lines in a child theme or small plugin, then block readme and license files at the server, but treat this as housekeeping: a version number only helps attackers when it is old, so updating matters far more than hiding. Confirm the result in the page source and feeds.
Updated November 29, 2026 · For WordPress site owners and developers
- For owners and developers tidying version leaks from WordPress and WooCommerce
- Code remove_action( 'wp_head', 'wp_generator' ) and the_generator filter
- Other leaks ?ver= URLs, readme.html, license.txt, plugin readme.txt, feeds
- Priority update first, hide second
- Safety back up first; do not edit core files
- Test page source, /feed/, /readme.html, SEO and monitoring tools
- Help security service and maintenance service
On this page
- Why does the version number matter?
- How do I remove the WordPress and WooCommerce version?
- Where else does the version leak?
- How do I confirm it worked?
- Worked example: a site that scores badly on a scan
- What about multisite and managed hosts?
- Does it help with search or speed?
- What actually keeps a site safe, and which hardening steps are worth it?
- FAQ
By default WordPress prints its version in your page source, and WooCommerce adds its own. Remove them with two lines in a child theme or small plugin, but treat that as housekeeping and keep your software updated.
This post focuses on the version number. For tags added by other plugins, see removing meta generator tags.
Why does the version number matter?
A version number tells a scanner which known vulnerabilities to try. If you run the latest release, that information helps nobody. If you run an old one, it helps attackers pick a target. Hiding it makes the first step slightly harder, and nothing more: scanners can still identify WordPress from file paths and behavior.
How do I remove the WordPress and WooCommerce version?
remove_action( 'wp_head', 'wp_generator' );
add_filter( 'the_generator', '__return_empty_string' );The first line stops the generator meta tag in your page head. The second empties the generator string in feeds and other places WordPress prints it. Check /feed/ as well as the page source.
WooCommerce prints its version in a generator tag, and in current releases it adds it by filtering WordPress's generator output, so the lines above should hide it too. Confirm in your own page source rather than trusting any one snippet. If a WooCommerce tag remains, search the source for generator, find the function that prints it and remove it with remove_filter() using the same hook name and priority.
Where else does the version leak?
| Place | What shows | What to do |
|---|---|---|
| Script and style URLs | ?ver= followed by a version | Leave alone; removing causes stale files |
readme.html and license.txt | The core version | Delete if present; re-check after updates |
Plugin readme.txt files | Plugin versions | Deny public access with a server rule |
| RSS feeds | Generator string | Covered by the filter above |
| Login page | Version on a very old install | Update |
A web server rule is the cleanest way to block the text files:
<FilesMatch "^(readme|license)\.(html|txt)$">
Require all denied
</FilesMatch>Nginx and other servers have equivalents. Back up your configuration first. If your host manages it, ask them to deny those files, and explain exactly which. A wrong rule can take the site down.
How do I confirm it worked?
- Open the home page
in a private window and view the source.
- Search for
generatorandver=. - Open
/feed/,/readme.htmland/license.txt. - Test
an SEO plugin, uptime monitor and any tool that reads your site.
Worked example: a site that scores badly on a scan
An automated scanner reports "WordPress 5.x detected" on a site that is in fact fully updated. The version came from the generator tag, so the report looked alarming. Removing the tag and readme.html clears that line, but the more useful discovery is a plugin three releases behind, which the scanner found through its readme.txt. Updating that plugin matters far more. Use scan reports to find what to update, not to decide what to hide.
What about multisite and managed hosts?
Some managed hosts already remove the generator tag or block the readme files, so check the source before adding code. On multisite, a filter in a network-activated plugin applies to every site. Do not edit server configuration yourself if the host controls it.
Does it help with search or speed?
No. It has no effect on rankings and any speed difference is a few bytes. The reason to do it is to avoid advertising your exact version, and the reason not to rely on it is that it fixes nothing underneath.
What actually keeps a site safe, and which hardening steps are worth it?
- Core, plugin and theme updates applied promptly, with a backup before.
- Strong unique passwords and two-factor authentication for administrators.
- Fewer plugins, from maintained authors.
- A firewall and malware scanning.
- Working, tested backups: see what to back up and how to test a restore.
- Someone watching it all: a care plan or our security service.
| Hardening step | Stops | Breaks if wrong |
|---|---|---|
| Hide the generator tag | Casual identification | Almost nothing |
| Change the login address (how) | Some automated scanning | Bookmarks, some plugins |
| Block XML-RPC | One class of password guessing | Mobile app and services that use it |
| Block the REST API entirely | Little | Parts of the block editor and many features, so do not do it |
None of these fixes a vulnerable plugin. Keep a short note of every hardening change and re-check after major updates, since a plugin or theme change can quietly bring a tag back.
Updates, monitoring and tested backups, on a care plan.
Should I hide my WordPress version?
It is a small tidy-up that removes an easy label. It does not make an outdated site safe. Updating is the real defense.
Link to this answerWhere else does the version appear?
In RSS feeds, in readme and license files, in script and style URLs and sometimes in plugin output.
Link to this answerWill hiding the version break any plugin?
Occasionally a tool uses the generator tag to detect WordPress. Test your SEO and monitoring tools after the change.
Link to this answerWhy does the version number matter at all?
It tells a scanner which known vulnerabilities to try. If you run the latest release that helps nobody; if you run an old one it helps attackers pick a target. Hiding it makes the first step slightly harder and nothing more.
Link to this answerHow do I remove the WordPress version?
In a small plugin or a child theme's functions.php after a backup, add remove_action( 'wp_head', 'wp_generator' ) and add_filter( 'the_generator', '__return_empty_string' ). Check /feed/ as well as the page source.
Link to this answerDoes the same code hide the WooCommerce version?
Current WooCommerce adds its tag by filtering WordPress's generator output, so it should hide too. Confirm in your page source, since plugin internals change, and use remove_filter() with the same hook and priority if a tag remains.
Link to this answerShould I remove the ?ver= from script and style URLs?
For most sites, leave them alone. They are used for cache busting, so removing them can leave returning visitors with stale files.
Link to this answerHow do I hide readme.html and license.txt?
Delete them from the WordPress root if present and re-check after updates, and use a server rule to deny public access to readme and license files. A wrong rule can take the site down, so back up and ask your host if they manage the configuration.
Link to this answerDoes hiding the version help rankings or speed?
No. It has no effect on rankings, and any speed difference is a few bytes. The reason to do it is to avoid advertising your exact version to automated scanners.
Link to this answerWhat keeps a WordPress site actually safe?
Prompt updates with a backup first, strong unique passwords and two-factor authentication, fewer plugins from maintained authors, a firewall and malware scanning, and working tested backups.
Link to this answerIs blocking XML-RPC or the REST API a good hardening step?
Blocking XML-RPC stops one class of password-guessing attack but breaks the mobile app and some services that use it. Blocking the REST API entirely breaks useful features including parts of the block editor, so do not do that.
Link to this answerKeep reading
Want an engineer on it?
Tell us what is wrong in plain words. A person reads it, today.