Created
May 9, 2017 11:07
-
-
Save proweb/99551ec75cf55b8ed523e0d83aa1209e to your computer and use it in GitHub Desktop.
Drupal 7 - remove shortlink, rel=alternate and generator meta tag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function themename_html_head_alter(&$head_elements) { | |
foreach ($head_elements as $key => $element) { | |
if (isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'shortlink') { | |
unset($head_elements[$key]); | |
} | |
if (isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'alternate') { | |
unset($head_elements[$key]); | |
} | |
} | |
unset($head_elements['system_meta_generator']); | |
$head_elements['system_meta_content_type']['#attributes'] = array( | |
'charset' => 'utf-8' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment