Hiding the Meta Generator Tag in WordPress in the Header and RSS

How to hide the Meta Generator tag in the WordPress Header and RSS Feeds



If you check the source code of your WordPress blog, in the header section you will see a meta tag named ‘generator‘ directly below the title tag:

<meta name="generator" content="WordPress 4.1.0" />

The purpose of the tag is  to state the name and version  of the application tool used to create your website. The bad thing about this is that it openly declares what software and version you are using – if that software and version are out of date and subject to exploitation by a hack you are leaving yourself wide open.

In the WordPress installation folder, go to and open the functions.php file from your theme folder  or  just edit the file directly in WordPress via Appearance>Editor>functions.php – it has a onscreen title of theme functions and at the bottom of the file add this following php snippet:

// hide the meta tag generator from head and rss
function disable_meta_generator() { 
 return ''; 
remove_action('wp_head', 'wp_generator');

Update the file, and reload the home page, check the source code and you will see the generator tag for WordPress is no longer visible.  More importantly always keep your WordPress version up to date.