Unset the Canonical Tag form head in Drupal 7

0
36

Unset the Canonical Tag form head in Drupal 7, this article will show you how to alter head tag in drupal, how to unset head tag. given some steps how to unset.

Drupal Related query!!


function hook_html_head_alter(&$head_elements) {
print_r($head_elements);
}

Related article

Result:


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
)

[system_meta_generator] => Array
(
[#type] => html_tag
[#tag] => meta
[#attributes] => Array
(
[name] => Generator
[content] => Drupal 7 (http://drupal.org)
)

[#attached] => Array
(
[drupal_add_http_header] => Array
(
[0] => Array
(
[0] => X-Generator
[1] => Drupal 7 (http://drupal.org)
)

)

)

[#access] =>
)

[drupal_add_html_head_link:shortcut icon:http://www.letmecrazy.com/sites/default/files/favicon.ico] => Array
(
[#tag] => link
[#attributes] => Array
(
[rel] => shortcut icon
[href] => http://www.letmecrazy.com/sites/default/files/favicon.ico
[type] => image/vnd.xnxm.icon
)

[#type] => html_tag
)

[datalayer_meta] => Array
(
[#type] => html_tag
[#tag] => script
[#value] => dataLayer =
[#attributes] => Array
(
[type] => text/javascript
)

)

[desc] => Array
(
[#type] => markup
[#markup] =>
)

[root_link] => Array
(
[#type] => markup
[#markup] =>
[#weight] => -5
)

[metatag_canonical] => Array
(
[#value] => http://www.letmecrazy.com/
)

[fav_icon] => Array
(
[#type] => markup
[#markup] =>
)

)

 

Unset the head Tag from head : 


function hook_html_head_alter(&$head_elements) {

unset($head_elements['drupal_add_html_head_link:shortcut icon:http://www.letmecrazy.com/sites/default/files/favicon.ico']);

}

 

 

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here