Remove generator metatag from Drupal

If you want to delete automated metatag from drupal (<meta name=”Generator” content=”Drupal 7 (” />) then the following code may be useful for you:

Just make a function yourthemename_html_head_alter() under your themes template.php and try the below code:

function yourthemename_html_head_alter(&$head_elements) {

Instead of that  unset($head_elements[‘system_meta_generator’]); can also work but the above code worked for me.

I got  metatag_generator array when i print the $head_elements array .So logically we should unset metatag_generator if we want to remove <meta name=”Generator” content=”Drupal 7 (” /> .

Leave a Reply

Your email address will not be published. Required fields are marked *