Home » How To

How To Remove The WordPress Version From Your Theme

My earlier post on the generator metatag problem (which shows the WordPress version on the Internet) includes a simple solution – one line of code in your theme.

However, it’s not always the best solution:

  • If you move between themes a lot, keeping track of which ones are ‘leaking’ security info can be annoying.
  • Editing each of theme can add up as well.
  • If you don’t want to edit a theme (for instance, you are using ABTheme), then another solution would be better.

That other solution of course is to wrap the line into a plugin, like this:

<?php
/*==============================================================================
Plugin Name: utopia51/Kill Generator Metatag in WordPress Page Header
Author: David Pankhurst
Version: 1.00
Author URI: http://ActiveBlogging.com/
Description: Removes the generator metatag showing the WordPress version from your theme
Plugin URI: http://activeblogging.com/info/wordpress-plugin-how-to-kill-version-generator-metatag
==============================================================================*/
static $utopia51_once=0;
if ($utopia51_once++<1)
  remove_action('wp_head','wp_generator');
//------------------------------------------------------------------------------
?>

You can download it in the plugins section (utopia51, ‘Fix Meta Version Tag’).

Just drop the utopia51.php plugin file in your /wp-content/plugins/ directory, and activate – the result is your theme will no longer show your version!

Digg this! Add to del.icio.us! Stumble this! Add to Techorati! Share on Facebook! Seed Newsvine! Reddit! Add to Yahoo!

3 Comments »

  • Inez said:

    Thank you for the plugin! I really didn’t want to edit my WordPress theme.

  • Sree said:

    Hi – I loaded Utopia.zip as plugin, and had to uninstall it. After having done that, I realise that my homepage is still carrying your comment on top of the Page. How do I remove this. This is urgent, regds, Sree

  • David Pankhurst (author) said:

    The plugin actually REMOVES the WordPress version number ‘comment’ – so when you deactivated/uninstalled it, it appears again, since it’s built in.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

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

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.