This Module don`t remove Generator META tag. Using Drupal 7.12.
To fix this problem, replace $head_elements['system_metatag_generator'] with $head_elements['metatag_generator'] in function remove_generator_html_head_alter()
Complete function after replacing:

function remove_generator_html_head_alter(&$head_elements) {
  // Remove Generator META tag.
  if (isset($head_elements['metatag_generator'])) {
    unset($head_elements['metatag_generator']);
  }
}
CommentFileSizeAuthor
#4 dsm.png59.82 KBseandunaway
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

seandunaway’s picture

Status: Active » Postponed (maintainer needs more info)

The tests are still passing for me locally and also on the testbots (http://qa.drupal.org/pifr/test/193234).

I just upgraded to 7.12 and still it's removing the tag... Please advise?

seandunaway’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Please reopen if you continue to have issues with this or my assessment is not correct! Thank you for taking the time dimasikov!

dstorozhuk’s picture

Here is print_r() of my $head_elementsin module implementation of hook_html_head_alter()
My site http://kranio.pp.ua.

<?php
/**
 * Implements hook_html_head_alter().
 */
function remove_generator_html_head_alter(&$head_elements) {
  // Remove Generator META tag.
  print_r($head_elements);
  if (isset($head_elements['system_meta_generator'])) {
    unset($head_elements['system_meta_generator']);
  }
}
?>
<pre>
Array
(
    [system_meta_content_type] => Array
        (
            [#type] => html_tag
            [#tag] => meta
            [#attributes] => Array
                (
                    [http-equiv] => Content-Type
                    [content] => text/html; charset=utf-8
                )

            [#weight] => -1000
        )

    [metatag_generator] => Array
        (
            [#theme] => metatag
            [#tag] => meta
            [#id] => metatag_generator
            [#name] => generator
            [#value] => Drupal 7 (http://drupal.org)
            [#attached] => Array
                (
                    [drupal_add_http_header] => Array
                        (
                            [0] => Array
                                (
                                    [0] => X-Generator
                                    [1] => Drupal 7 (http://drupal.org)
                                )

                        )

                )

            [#type] => html_tag
        )

    [metatag_og:type] => Array
        (
            [#theme] => metatag_opengraph
            [#tag] => meta
            [#id] => metatag_og:type
            [#name] => og:type
            [#value] => article
            [#type] => html_tag
        )

    [metatag_og:title] => Array
        (
            [#theme] => metatag_opengraph
            [#tag] => meta
            [#id] => metatag_og:title
            [#name] => og:title
            [#value] => Информация о пользователе
            [#type] => html_tag
        )

    [metatag_og:site_name] => Array
        (
            [#theme] => metatag_opengraph
            [#tag] => meta
            [#id] => metatag_og:site_name
            [#name] => og:site_name
            [#value] => Кранио-сакральная терапия
            [#type] => html_tag
        )

    [metatag_og:url] => Array
        (
            [#theme] => metatag_opengraph
            [#tag] => meta
            [#id] => metatag_og:url
            [#name] => og:url
            [#value] => http://kranio.pp.ua/?q=user
            [#type] => html_tag
        )

)
</pre>
seandunaway’s picture

FileSize
59.82 KB
Drupal core                7.12               7.12              Up to date
Remove Generator META tag  7.x-1.4            7.x-1.4           Up to date

dsm

This is mine for the latest versions of d7 and Remove Generator META tag.

I can't figure out why yours is different than mine.

seandunaway’s picture

I see - It's because you have the Metatag module installed. For some reason it remove the default generator tag and renames it.

seandunaway’s picture

Status: Closed (cannot reproduce) » Closed (works as designed)

If you have the Metatag module enabled then you can disable the Generator in the advanced options at:

admin/config/search/metatags/config/global
dstorozhuk’s picture

Status: Closed (works as designed) » Closed (fixed)

Yes, thanks, am realy have instaled Metatag module. Problem fixed.

klonos’s picture

Title: Module don`t remove Generator META tag » Display a warning in the site status page when Metatag module is installed and enabled...
Category: bug » feature
Priority: Critical » Normal
Status: Closed (fixed) » Active

...so that people don't get puzzled by this "bug".

Also, if people install Metatag long after they install this module, the fact that the Generator tag is back may go unnoticed for quite a long time (that's what personally happened to me).

PS: sorry, for hijacking this issue but I didn't want to risk having a new one closed as duplicate of this. Let me know if you feel I should file a separate one.

seandunaway’s picture

Status: Active » Closed (fixed)

I dont think its super critical because when people install Metatags and go through the options the Generator settings are there and easily configurable. It's not like Metatags breaks this module, it just adds its own generator.

ashawley’s picture

Issue summary: View changes

Perhaps change this module's homepage to mention that this module is deprecated by the Metatag module in Drupal 7.