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');
Comments
7 Responses to “Remove Generator Field From WordPress Meta”
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.
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.
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.
DG - Thursday, December 11th, 2008 at 5:23 am :
Thanks for this especially adding the part that removes generator metaname from Feeds.
Chris - Wednesday, December 24th, 2008 at 10:12 am :
I get this after adding to my functions.php file:
Fatal error: Call to undefined function remove_action() in /pathto/wp-includes/functions.php on line 25
links for 2009-01-28 « Free Open Source Directory - Wednesday, January 28th, 2009 at 5:01 pm :
[...] Remove Generator Field From WordPress Meta – Kenny Carlile WordPress automagically interjects meta content specifying that the generator of the webpage is WordPress and, specifically, what version it is. Like this: [...]
V.C - Wednesday, July 8th, 2009 at 3:28 am :
Just use this code and paste it into your function.php:
/* Remove WordPress generator meta tag */
function rmv_generator_filter() {
return "; }
add_filter('the_generator', 'rmv_generator_filter');
Leave a Reply
Social
Friends
About | Professional | Interests | Blog | RSS Feed
Copyright ©2012 Kenny Carlile. All rights reserved.