{"id":170,"date":"2008-09-26T18:54:02","date_gmt":"2008-09-26T15:54:02","guid":{"rendered":"https:\/\/www.optimiced.com\/en\/?p=170"},"modified":"2008-09-26T19:01:13","modified_gmt":"2008-09-26T16:01:13","slug":"how-to-remove-meta-name-generator-content-wordpress","status":"publish","type":"post","link":"https:\/\/www.optimiced.com\/en\/2008\/09\/26\/how-to-remove-meta-name-generator-content-wordpress\/","title":{"rendered":"How to remove &lt;meta name=&quot;generator&quot; content=&quot;WordPress&#8230;&quot; \/&gt; from &lt;head&gt; in a WP blog"},"content":{"rendered":"<p>I met with the following interesting problem today:<\/p>\n<p>Due to specific needs, I needed to remove from the HEAD part of one WordPress blog the following:<\/p>\n<p><code><br \/>\n&lt;meta name=&quot;generator&quot; content=&quot;WordPress [version number]&quot; \/&gt;<br \/>\n<\/code><\/p>\n<p>The WP theme, in which I was making the changes, was the standard for WP <em>Default Kubrick Theme<\/em>. The WP version I was using was 2.6.2.<\/p>\n<p>I was searching and searching inside the code of <code>header.php<\/code> &#8212; and did not find anything! Before, in every WP theme, in <code>header.php<\/code>, usually the following code was present:<\/p>\n<p><code><br \/>\n &lt;meta name=&quot;generator&quot; content=&quot;WordPress &lt;?php bloginfo('version'); ?&gt;&quot; \/&gt;&lt;!-- leave this for stats --&gt;<br \/>\n<\/code><\/p>\n<p>Now, I wasn&#8217;t able to find it&#8230;<\/p>\n<p>I tried also <em>global search<\/em> inside all of the files of this theme, and again, with total un-success. Finally, I tried the last possible option &#8212; Google Seach&#8230;<\/p>\n<p>&#8230;And have <a href=\"http:\/\/wordpress.org\/support\/topic\/164884\">found it<\/a>! :-)<\/p>\n<p>In short: if you want to hide from the HTML code <code>\"&lt;meta name=&quot;generator&quot; content=&quot;WordPress ...&quot; \/&gt;<\/code>, as well as the exact WP version you are using, all you need to do is (in case that you don&#8217;t find the code inside <code>header.php<\/code> &#8212; for example, in WP up to version 2.3.3, the code was usually there):<\/p>\n<p>1) Locate and open with a text code editor the file <code>functions.php<\/code> inside the theme directory &#8212; for example, if you are using the Default Theme, the <code>functions.php<\/code> will be in <code>wp-content\/themes\/default\/functions.php<\/code>.<br \/>\n2) Add inside it the following code:<br \/>\n<code>remove_action(&#39;wp_head&#39;, &#39;wp_generator&#39;);<\/code><br \/>\n3) Save the file <code>functions.php<\/code> and upload it back to the server.<\/p>\n<p>That&#8217;s it! <em>Automagically<\/em>, the code, which shows that you are using WordPress, as well as the exact version of it, will disappear from the HTML source! :-)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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: &lt;meta name=&quot;generator&quot; content=&quot;WordPress [version number]&quot; \/&gt; The WP theme, in which I was making the changes, was the standard for WP Default Kubrick Theme. The WP version I was&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-170","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/posts\/170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/comments?post=170"}],"version-history":[{"count":9,"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/posts\/170\/revisions"}],"predecessor-version":[{"id":178,"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/posts\/170\/revisions\/178"}],"wp:attachment":[{"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/media?parent=170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/categories?post=170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/tags?post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}