Use Only Genuine Interocitor Parts

Add to Technorati Favorites

Endorsements

Firefox 3

Remove Generator Field From WordPress Meta

Wednesday, June 18th, 2008 at 2:03 pm by Kenny

WordPress automagically interjects meta content specifying that the generator of the webpage is WordPress and, specifically, what version it is. Like this:

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

If you want to remove that, there's an easy way to do it. If you don't already have a functions.php file in your theme, create one. Make sure that it starts with <?php and ends with ?> and has NOTHING outside those tags or it will cause your theme to yak.

Now add the following line to your functions.php file:

remove_action('wp_head', 'wp_generator');

And that should do it! Now you can go through all your plugins and remove the comments and other garbage they interject in order to try to hide the fact that you're running WordPress.

Edit:

As Jerry pointed out in the comments, you could still see the generator meta in the RSS feed. I found a solution to this at Bioneural.net.

Simply add this code to your theme's functions.php file.

// Remove WP version info
function hide_wp_vers()
{
    return '';
} // end hide_wp_vers function

add_filter('the_generator','hide_wp_vers');

  • E-mail this story to a friend!
  • Google
  • Digg
  • Technorati
  • del.icio.us
  • Slashdot
  • TwitThis
  • Furl
  • Fark
  • Reddit
  • StumbleUpon
  • Facebook

Posted in WordPress |

You can follow any responses to this entry through the RSS 2.0 feed. Trackback from your own site.

3 Responses to “Remove Generator Field From WordPress Meta”

  1. Jerry - Wednesday, July 9th, 2008 at 8:47 pm :

    And how do you remove the tag from your feed? I can see what version of WP you're running by looking at that.

  2. Kenny - Wednesday, July 9th, 2008 at 9:19 pm :

    Great point, Jerry. I'm glad you caught that. Thanks to a little bit of Googling and some great work from Bruce at Bioneural.net, we have a solution! See the post for my addendum.

  3. Jerry - Thursday, July 10th, 2008 at 3:57 am :

    Works great! Thank you very much for looking into it and posting a solution so quickly.

Leave a Reply