Created
December 7, 2013 16:31
-
-
Save esafwan/7844845 to your computer and use it in GitHub Desktop.
Unset Canonical Tag in Drupal using hook_html_head_alter(). https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_html_head_alter/7
This file contains 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
<?php | |
function my_module_html_head_alter(&$head_elements) { | |
foreach ($head_elements as $key => $element) { | |
if (isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'canonical') { | |
unset($head_elements[$key]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment