When both Metatag and Global redirect are configured to output canonical tags, the end result is duplicate tags. For some reason the checking in metatag_html_head_alter() is only overriding core tags, but not the Global redirect one, which is added with the following code in globalredirect_init():

drupal_add_html_head_link(array(
  'rel' => 'canonical',
  'href' => url(drupal_is_front_page() ? '<front>' : $request_path, array('absolute' => TRUE, 'query' => $query_string)),
));

Comments

dave reid’s picture

Ah, I'm guessing that it's because we have a break; call in the foreach() loop in metatag_html_head_alter(). It needs to check all entries in $elements and not just assume there is only one.

dave reid’s picture

Status: Fixed » Closed (fixed)

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