Friday , December 20 2024

How to remove generator in Drupal 7

By default, the source code of Drupal sites contains the line <meta name=”generator” content=”Drupal 7 (http://drupal.org)” />

To remove it, you need to edit the file /sites/all/themes/mytheme/template.php (instead of mytheme, go to your site’s theme folder), find function shop_adaptive_html_head_alter and add before the closing character } this line:

unset($head_elements['metatag_generator_0']);

If it doesn’t work, try these options:

 unset($head_elements['system_meta_generator']);

or

unset($head_elements['metatag_generator']);

If there was no mention of function shop_adaptive_html_head_alter in the template.php file, then add the function:

function shop_adaptive_html_head_alter(&$head_elements) {
  unset($head_elements['metatag_generator_0']);
}

with options for unset from the examples above.

About admin

Hi there! My name is Iryna, I am a web developer from Ukraine. While working on freelance projects I often face different technical issues and in this blog I publish articles on how to solve them. I am also interested in digital drawing and in this blog you will find brief tutorials that helped me and hopefully can help you as well.

Check Also

Popup image on click without href

A very elegant solution, with which the image will not be wrapped in <a href=””></a>, …

Leave a Reply

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