Skip to content

Sites Metatag

Sets the canonical link and the hreflang alternates of content pages from the sites that show the content, through Metatag. Metatag's Canonical URL tag follows the sites: Torqline, showing the group's press release, names the page on Valtora, its origin site, as canonical. The Hreflang alternates (Sites) tag names the page's translations there. Without the module, every site's canonical link names its own page, and the status report warns.

Install

Ships with Sites; with that project in the codebase:

drush en sites_metatag

Requires Sites, metatag (metatag).

Configure

  1. Enable the module with Drush: its install switches on the hreflang and shortlink tags in Metatag's global defaults, a step it skips during a configuration import. Export the configuration afterwards, so the other environments get the tags with it.
  2. Leave metatag_hreflang off: the Hreflang alternates (Sites) tag sets the alternates.
  3. In each site's Identity section (/admin/sites/{site}/identity), a platform administrator sets Canonical link: This site, The content's origin site (the default) or None (Sites adds no canonical link). Region takes a two-letter country code, like GB for Hydrion UK and US for Hydrion US. What a region changes in both links: Canonical link and hreflang.
  4. To let editors change both links for one content item, add a meta tags field to its content type (Change them for one content item).

Settings without a form

sites_metatag.settings has no form. Its defaults follow Google's guidance on canonical and localized pages; change a key with Drush or in settings.php:

Key Default Decides
canonical.across_regions false Whether The content's origin site may name a site of another Region. Off, a site with a region names a site of its own region, or itself (The canonical link).
canonical.own_variants true Whether a site that shows its own version of the content names itself.
hreflang.canonical_pages_only true Whether only a page whose canonical link names itself carries alternates.
hreflang.minimum 2 The fewest alternates a page carries; below it, none.
hreflang.x_default true Whether an x-default alternate names the page on the content's origin site.

Last updated 2026-10-16

Used in