Disable WP Version Number Without Plugin in WordPress

Disable WP Version Number Without Plugin to keep your WordPress site safer from bots scanning for vulnerabilities. Here’s how to do it with a single line in your child theme.

Step 1: Add the WP Version Number Disable Code

Add this line to your child theme’s functions.php:


remove_action(‘wp_head’, ‘wp_generator’);

How It Works

This line removes the WordPress version meta tag from your site’s header, making it harder for bots to detect which version you’re using.

Why Disable WP Version Number Without Plugin?

Showing your WordPress version can help attackers find known exploits that target specific versions. Removing it is a quick security boost.

Common Mistake

Some themes or plugins may still append version numbers to CSS or JS files. Always check your page source after applying this tweak.

Pro Tip

Add this tweak in your child theme’s functions.php to make sure it stays in place after theme updates.

Related Snippet

If you liked this, check out my guide on disabling directory browsing without a plugin in WordPress.

Leave a Comment