<meta name="MobileOptimized" content="width">
<meta name="HandheldFriendly" content="true">
<link rel="revision" href="http://freebornd8.docksal/attorney/jill-c-anderson">

can these be removed using this module? I tried adding them to settings with no results.

Comments

galactus86 created an issue. See original summary.

galactus86’s picture

Issue summary: View changes
orlando.thoeny’s picture

Hello,
no this is not in the scope of this module.

You can do this by creating a similar hook like the following inside of a custom module's .module file:

/**
 * Remove the "Generator" meta tag from the <head> section.
 *
 * If the "X-Generator" should be removed.
 *
 * @code
 * <head>
 *    <meta name="Generator" content="Drupal 8 (https://www.drupal.org)">
 * </head>
 * @endcode
 */
function remove_http_headers_page_attachments_alter(array &$attachments) {
  /** @var \Drupal\remove_http_headers\Config\ConfigManager $config_manager */
  $config_manager = Drupal::service('remove_http_headers.config_manager');

  if ($config_manager->shouldHeaderBeRemoved('X-Generator')) {
    foreach ($attachments['#attached']['html_head'] as $key => $attachment) {
      if ($attachment[1] == 'system_meta_generator') {
        unset($attachments['#attached']['html_head'][$key]);
      }
    }
  }
}

orlando.thoeny’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.