How do I set canonical links with Drupal Metatag?

The Citead team, updated

In short. Set the canonical URL in Metatag defaults or a content override, using a URL token or a complete preferred URL, and check the resulting HTML link.

Definition: A canonical link identifies the preferred URL for a page's content. Drupal Metatag supplies a canonical_url setting whose value can use a token, a placeholder that automatically supplies a value, or a specific URL.

Key facts

Where is the canonical URL configured?

The Metatag README gives this administration path:

/admin/config/search/metatag

Global values provide the base defaults. Each entity type, such as content or taxonomy terms, has another layer of defaults. A bundle is a subdivision of an entity type, such as a content type. The "Add default meta tags" action adds settings for a particular bundle, overriding its entity defaults.

For a single page override, the documentation requires a Metatag field on the relevant bundle. In "Manage fields", the "Add a new field" selector offers "Meta tags". Once that field is available, an editor can set the page's canonical URL value and save the content.

Which token belongs in the value?

For a token-based Global value, the shipped configuration contains:

canonical_url: '[current-page:url]'

The Content defaults instead contain:

canonical_url: '[node:url]'

These are configuration excerpts; the value entered in the canonical URL form field is the bracketed token. The Global token refers to the current page's URL, while the Content default uses the content item's URL. The Content record supplies its own canonical setting, so checking both default records identifies which token applies.

The README identifies Token as a required module and describes its popup browser for available tokens. That browser supplies the token choices for the site's fields. For an intentional page-specific canonical, a complete preferred URL can replace the token in the override.

Google's canonical documentation places the canonical link in the HTML head and recommends absolute URLs. Its example includes:

<link rel="canonical" href="https://example.com/dresses/green-dresses" />

After saving the setting, inspect the published page's HTML source for rel="canonical" and compare its href with the intended preferred URL. The output should contain the resolved URL. The same guidance recommends a self-referential canonical on the preferred page itself and consistent canonical choices across link annotations and sitemaps.

FAQ

Can I give one content page a different canonical URL?

Yes. The Metatag README describes entity overrides through a Metatag field. You can add that field to the content type and edit the individual page's metadata.

Does saving the canonical force Google's selection?

Google's guidance describes the link as a strong signal. You can express a preferred URL through it; Google also uses other canonicalization signals.

Sources

  1. Drupal Metatag maintainers, "Metatag README", release 2.2.0
  2. Drupal Metatag maintainers, "Global defaults configuration", release 2.2.0
  3. Drupal Metatag maintainers, "Content defaults configuration", release 2.2.0
  4. Google Search Central, "How to specify a canonical URL with rel=canonical and other methods", 10 July 2026

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark