Remove WordPress version from header

It’s very easy to track the version of WordPress you are running on your site. Because it’s that easy, it can also mean a security leak. Especially if you don’t update WordPress frequently.

There is an easy way to hide the version number. Just add this code to the functions.php of the theme you’re using.

// remove version info from head and feeds
function complete_version_removal() {
    return '';
}
add_filter('the_generator', 'complete_version_removal');

Always backup your functions.php before changing it!

An alternative way to remove the version number is to edit the header.php of the theme you are using. Open the header.php and remove this code:

<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />

Always backup your header.php before changing it!

These changes will get lost when you change to another theme. Make sure to edit the functions.php or header.php of your new theme!

Ronald Heijnes
Ronald Heijnes

Since 2008 I keep myself busy with the functionality, management, maintenance and performance of self hosted WordPress. I like to share this knowledge. All in my spare time!

Articles: 44

Leave a Reply

Your email address will not be published. Required fields are marked *