Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm using both Global Redirect and Metatags. And getting duplicate canonical metatags as a result.
<link rel="canonical" href="/professional-development/programs" />
<link rel="shortlink" href="/node/543" />
<meta content="Programs" about="/professional-development/programs" property="dc:title" />
<link rel="canonical" href="http://mywebsite.edu/professional-development/programs" />
For a while I think there was a work around by adding an empty space. On this page ( "http://mywebsite.edu/admin/config/search/metatags/config/global" under the advanced section.
The pervious posts on the issue had workarounds and patches but they were from older versions of the module and don't work anymore. So pls don't call this a duplicate issue.
I will heap mountains of good karma on someone had a workaround for this. Launching site tomorrow.
Thank you!!!!!!
Comments
Comment #1
DamienMcKennaThis is by design - you have enabled two modules that each output a canonical URL meta tag. What you need to do is either disable the canonical URL option in GlobalRedirect, or disable the tag in Metatag by removing the value in all of the configurations (global, front page, content, etc).
Comment #2
joelhsmith CreditAttribution: joelhsmith commentedThanks. I have removed them in all the locations but still get both. Any other ideas?
Comment #3
DamienMcKennaIf you disabled them in Metatag you'll need to clear the caches to make Metatag reload the configuration for each node.
Comment #4
joelhsmith CreditAttribution: joelhsmith commentedWas a cache issue. Stupid me. Thank you! I'm sending warm thoughts and good karma your way :-)
Comment #5
DamienMcKennaFrom the hassle you went through with this I've added a new issue to the backlog to automatically clear the caches after the configurations are changed: #2319357: Clear caches after configuration changes
Thank you for your unintended contribution! :-)
Comment #6
metaltoad CreditAttribution: metaltoad commentedDamienMcKenna this was super helpful. Thank you!