How to remove <meta name="generator" content="WordPress…" /> from <head> in a WP blog
I met with the following interesting problem today:
Due to specific needs, I needed to remove from the HEAD part of one WordPress blog the following:
<meta name="generator" content="WordPress [version number]" />
The WP theme, in which I was making the changes, was the standard for WP Default Kubrick Theme. The WP version I was using was 2.6.2.
I was searching and searching inside the code of header.php — and did not find anything! Before, in every WP theme, in header.php, usually the following code was present:
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /><!-- leave this for stats -->
Now, I wasn’t able to find it…
I tried also global search inside all of the files of this theme, and again, with total un-success. Finally, I tried the last possible option — Google Seach…
…And have found it! :-)
In short: if you want to hide from the HTML code "<meta name="generator" content="WordPress ..." />, as well as the exact WP version you are using, all you need to do is (in case that you don’t find the code inside header.php — for example, in WP up to version 2.3.3, the code was usually there):
1) Locate and open with a text code editor the file functions.php inside the theme directory — for example, if you are using the Default Theme, the functions.php will be in wp-content/themes/default/functions.php.
2) Add inside it the following code:
remove_action('wp_head', 'wp_generator');
3) Save the file functions.php and upload it back to the server.
That’s it! Automagically, the code, which shows that you are using WordPress, as well as the exact version of it, will disappear from the HTML source! :-)
9 comments |


1 November 21st, 2008 at 02:13
Hey mate,
Thanks for the post :)
Cheers
2 December 11th, 2008 at 14:55
But what about removing metaname generator from the RSS and Atom Feeds too?
3 December 12th, 2008 at 11:03
Thanks for the fix!
4 January 9th, 2009 at 19:53
Thanks So much for the information. Im startingt to get involved in tweaking my own wordpress theme, and this helps alot. I have broken the theme many times, but for now, this should work nicely.
5 September 29th, 2009 at 01:05
[...] while ago I wrote a short post about an easy way to remove the following code from the HEAD of a WordPress [...]
6 January 14th, 2010 at 17:22
what happens if you just remove this line?
<meta name="generator" content="WordPress ” />
7 January 14th, 2010 at 20:52
Nothing happens. The info will still be added by WP to the
HEADsection of the website :)8 November 9th, 2010 at 22:56
thanks for sharing, regards :)
9 December 28th, 2010 at 22:58
Ah thanks for this. Was looking to see how I can get rid of some of the stuff that’s generated on each page. Seems like a waste and a drag on resources to me.