Removing the Generator Tag from WordPress

Before making changes to your theme, always make sure you backup your files.

Within your themes directory is a file called functions.php. Simply add this line to that file between the php tags (ex: under the <?php tag )

remove_action('wp_head', 'wp_generator');

This will remove the “generator” tag from appearing in the meta head section of your wordpress website.

You will likely also find a generator tag within the theme header file, and it will look something like this:

<meta name=”generator” content=”WordPress <?php bloginfo(‘version’); ?>” /><!– leave this for stats please –>

You can also safely remove these lines also if you’d like.

Why would I want to do this? Well, there is a small security gain to be made, as some malicious scanners will scan accross the web looking for vulnerable or certain versions of WordPress, and it is in your best interest not to broadcast it out.

Leave a Reply

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

 characters available

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>