Wordpress Snippets

Remove WordPress Generator Meta Tag Completely

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' );

Hire Us. Or just say Hi!
Need a job? Apply to get one.