How to Hide WordPress Version Number from Hackers: Essential Security Step
Why You Should Hide Your WordPress Version
WordPress automatically displays its version number in your site’s HTML source code, RSS feeds, and HTTP headers. While this seems harmless, it poses a serious security risk because:
- 🚨 Hackers target known vulnerabilities in specific WordPress versions.
- 🔍 Automated bots scan websites for outdated WordPress installations.
- ⚠️ Exposing your version makes attacks easier (e.g., exploits for WordPress 6.4.3).
Where WordPress Shows Its Version Number
- Page Source Code (
<meta name="generator" content="WordPress X.X.X" />
) - RSS/Atom Feeds (
<generator>https://wordpress.org/?v=X.X.X</generator>
) - Script & Style Handles (e.g.,
wp-includes/js/comment-reply.js?ver=X.X.X
) - HTTP Headers (
X-Powered-By: WordPress/X.X.X
). Our YouTube channel; https://www.youtube.com/@easythemestore
5 Ways to Hide WordPress Version Number
1. Remove Version from Meta Tag (Functions.php Method)
Add this code to your child theme’s functions.php
:
// Remove WordPress version from head/meta remove_action('wp_head', 'wp_generator');
✅ Effect: Removes <meta name="generator" content="WordPress X.X.X" />
2. Hide Version from RSS Feeds
Add this to functions.php
:
// Remove version from RSS feeds function remove_wp_version_rss() { return ''; } add_filter('the_generator', 'remove_wp_version_rss');
3. Remove Version from Scripts & Styles
Add this to functions.php
:
// Remove version from CSS/JS files function remove_wp_version_assets($src) { if (strpos($src, 'ver=')) { $src = remove_query_arg('ver', $src); } return $src; } add_filter('style_loader_src', 'remove_wp_version_assets', 9999); add_filter('script_loader_src', 'remove_wp_version_assets', 9999);
4. Disable WordPress Version in HTTP Headers
Add this to functions.php
:
// Remove version from HTTP headers function remove_wp_version_headers() { header_remove('X-Powered-By'); } add_action('send_headers', 'remove_wp_version_headers');
5. Use a Security Plugin (Easiest Method)
Plugins like:
- Hide My WP (renames WordPress paths)
- Sucuri Security (hardens WordPress)
- iThemes Security (hides version & other details)
Bonus: Advanced Protection
- Disable XML-RPC (used in brute-force attacks)
- Use a Web Application Firewall (WAF) (e.g., Cloudflare, Sucuri)
- Keep WordPress Updated (even if hidden, outdated versions are risky)
Conclusion
Hiding your WordPress version is a quick but powerful security measure. By removing version traces from HTML, RSS, scripts, and headers, you make it harder for hackers to exploit known vulnerabilities.
🚀 Next Steps:
- Add the
functions.php
snippets above. - Install a security plugin for extra protection.
- Always update WordPress to the latest version.
Less visibility = Fewer attacks! 🔒