Remove WordPress Generator Meta Tag Completely

How to Remove WordPress Generator Meta Tag Completely

in Security
Google+ LinkedIn

By default WordPress adds generator meta tag in website head section. The WordPress generator meta tag displays your website’s WordPress version for anyone to see.

It can be considered a security risk to make your WordPress version visible and public. Because you are providing the hacker with the useful information by telling them which version of WordPress you are running.

Although it is very easy to remove this meta tag without modifying core WordPress files. Just copy and paste this code snippet in your theme’s functions.php file and forget about it forever.

// remove WordPress generator meta tag completely
function wcs_remove_generator_tag() {
    return '';
}
add_filter( 'the_generator', 'wcs_remove_generator_tag' );

Share the love

If you like this snippet, share it with others!

Leave a Reply

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