Drupal Metatag configuration for SEO and social sharing

Metatag gives a Drupal site one place to set titles, descriptions, canonical URLs and social sharing tags across content types. This page covers how to plan the defaults, token patterns and checks before you configure it.

On this page

Why Drupal Metatag configuration matters for SEO and social sharing

A content team with many content types and no shared metadata rules will publish pages with missing, duplicated or inconsistent titles, descriptions and social previews. The Metatag module is the Drupal layer that fixes this at the system level rather than page by page. As documented on Drupal.org, it lets a site define default meta tags for each entity type and bundle, override them on individual pages, and generate values from tokens so that a article, a landing page and an event can each produce sensible output from fields that already exist. It also covers canonical URLs and Open Graph and Twitter Card tags, so the same content can display correctly when shared on social platforms. Teams usually need it before launch, because every page published without defaults is one more page to correct later, and during a Drupal 7 or other replatform, because the old site's metadata rarely maps cleanly onto the new content model.

The licensing question is settled before any cost discussion starts. Drupal and contributed modules hosted on Drupal.org are licensed under GPL-2.0-or-later, and there is no paid edition of Drupal, so the Metatag module carries no license fee. The money goes into planning and build effort: auditing which content types need which tags, deciding the token patterns and fallback order, mapping legacy metadata during migration, and testing output across templates. That effort is largely one-time, while ongoing work follows new content types and changing search or social requirements. Confirm the module's current release, supported Drupal versions and the exact tag sets it exposes against its Drupal.org project page before you commit to a design, since specifics can change between releases.

Which Metatag settings fit which content types

Metatag gives you several layers of control, from site-wide defaults to values set on a single node. The right mix depends on how many content types you run, how often editors override values, and whether search and social previews must follow a rule. Each card below is a decision to make and a maintenance cost to plan for before the configuration grows.

Site-wide defaults

Site-wide defaults supply the title, description, robots and social image values used wherever no narrower rule applies. They fit small sites with one audience and a single brand voice, and they are the fallback that prevents empty tags on pages editors forget. Keep defaults generic and short, because every page that inherits them will repeat the same text. Ask your partner to review the default set after each Metatag update, since the tag list it covers is documented on the module page and should be confirmed for your version.

Per-content-type token patterns

Token patterns fill metadata from fields such as the title, summary or taxonomy term, so one rule can cover every article, event or product. They fit sites with several content types that share a structure, and they cut the editorial effort of writing every description by hand. The cost is in testing: a pattern that works for a long article can produce a truncated or empty description for a short landing page. Plan a review of sample nodes for each bundle whenever fields change.

Per-entity overrides

Per-entity overrides let an editor replace the generated values on a single page, for example a campaign landing page with a tailored social description. They fit high-value pages where automated text would underperform. Every override is a value someone must remember to update when the page changes, so limit overrides to a short list of pages and check them during content reviews. Ask whether editors have a clear rule for when an override is allowed.

Canonical URL handling

Canonical URL output tells search engines which address represents a page when several paths lead to the same content, such as aliases, query strings or paginated listings. It fits sites that publish the same node under more than one path or that expose filtered views. Canonical tags interact with URL aliases and redirects, so a change to a pattern can move the canonical target. Verify the output on representative paths after every alias change, and confirm how your chosen version handles listing pages.

Open Graph and Twitter Card output

Open Graph and Twitter Card tags control how a link appears when shared on social platforms and in some messaging apps. They fit any site where marketing relies on shared links, and they need a default image, a dimension standard and a fallback when editors leave the image empty. Each platform caches previews on its own schedule, so a fix may not show immediately. Test a sample of URLs with each platform's debugging tool and record which tags your site emits.

When to use a separate structured data module

Metatag covers meta and social tags, while structured data for articles, organizations, events, products and FAQs is usually handled by a separate Schema.org Metatag configuration. Use a separate module when search features depend on JSON-LD that must match visible page content. Keeping the two concerns apart avoids mixing editorial meta values with markup rules that need their own testing. Confirm which module owns each tag before you write token patterns, so the same value is not maintained in two places.

Configuration options and when each fits

This table compares the Metatag configuration choices a team makes on a Drupal site, from site-wide defaults to per-entity overrides, canonical handling, social tags and language or multisite behavior. Read each row as a decision: the option, what it controls, when it suits the site and what it costs to maintain. The main takeaway is that token patterns set at the defaults level carry most of the work, and overrides should be reserved for content that genuinely differs.

OptionWhat it controlsWhen it fitsTrade-off
Site-wide global defaultsFallback title, description and robots values applied to every page that has no more specific valueEvery site needs a sane fallback so no page ships with empty or duplicated metadataA broad default is easy to set but can produce generic descriptions if no content-level pattern takes over
Token patterns per entity typeTitle and description formulas built from tokens such as title, summary and site name for each content typeSites with several content types that share a predictable structure, such as articles and product pagesPatterns scale well but need review when fields change, and tokens that are empty produce awkward output
Per-content overridesManual title, description, image and canonical values on an individual nodeHigh-value pages such as landing pages, campaign content or pages with editorial SEO ownershipGives precise control but adds editor workload and drifts out of date if content is copied or reused
Canonical URL settingsThe canonical link element that tells search engines which URL represents a page with duplicatesSites with filtered listings, paginated lists, alias variants or syndicated contentWrong canonicals can hide valid pages from search, so every rule needs testing against live URLs
Open Graph and Twitter Card tagsMetadata read by social platforms and messaging apps when a link is shared, including image and card typeSites where shared links drive traffic and previews must show the right image and summaryPlatforms cache previews, so changes may not appear immediately and need a debugger check after release
Language-specific metadataMetadata values that differ per translation and interact with language negotiation and hreflang outputMultilingual sites where each translation needs its own title, description and canonicalEach language adds token and override work, and fallback behavior for untranslated fields must be decided
Multisite or shared configurationWhether metatag defaults are shared across sites or set separately for each site in the estateOrganizations running several Drupal sites with a common brand and content modelShared defaults reduce drift but a change on one site can affect others, so ownership must be clear

How token patterns scale across content types

On a site with a handful of content types, the simplest approach is to set one pattern per entity type and bundle at the Metatag defaults level, then let each node inherit it. A pattern for the page title can combine the node title with the site name, and a description pattern can draw from the summary or body field with a length limit. Because there are few bundles, the team can read every pattern on one screen and confirm that each one makes sense for the content it applies to.

  • Start with the node title and site name: Use the page title token and the site name token so every page carries a clear, unique title in the browser tab and search results.
  • Set the description from a summary field first: Point the description pattern at a dedicated summary field where editors write one, and fall back to a trimmed body token only when no summary exists.
  • Keep canonical URLs on the node URL token: Let the canonical pattern resolve to the node's own URL so each piece of content names one preferred address.
  • Override only the front page and error pages: These pages rarely follow a content pattern, so set them by hand once and leave the rest to inheritance.
  • Write the rules down: A short table of bundle, title pattern, description pattern and canonical pattern lets a second person review the setup without opening the configuration.

Before launch, create one node per bundle with the summary and body left empty and confirm the output still reads sensibly.

How to set up Metatag step by step

This sequence moves a Drupal site from default head output to consistent titles, descriptions, canonical URLs and social sharing tags across every content type, with a check at each stage so the result can be confirmed before content editors rely on it.

  1. Install Metatag and its token dependency

    Your developer adds the Metatag module and the Token module to the codebase through Composer, enables both on a staging copy of the site, and confirms the Metatag settings pages load under the configuration area. Tokens are the mechanism that fills patterns such as the page title or summary from fields, so they must exist before any pattern is written. The step is done when both modules show as enabled in the module list and the Metatag defaults page opens without errors in the logs.

  2. Define global defaults for the whole site

    The site owner and developer agree on a site name, a fallback description and default Open Graph image, then enter them as global defaults in Metatag. These values apply wherever no more specific rule exists, so they should be written as safe fallbacks rather than marketing copy. Confirm the chosen values with your SEO and brand owners before saving. The step is done when an unrouted or uncategorized page renders a title and description in its page source.

  3. Set token patterns per content type

    For each content type, such as articles, landing pages and events, the team writes a title pattern and a description pattern using tokens for the node title, summary and site name. Keep patterns short and predictable, and where a field is often empty, agree a fallback token chain so no page is left blank. Ask an editor to review two or three real examples before rollout. The step is done when a test node of each type shows the expected title and description in the page source.

  4. Configure Open Graph and Twitter Card output

    The developer enables the Open Graph and Twitter Card groups in Metatag, maps the image, title and description to the same token sources used for search metadata, and sets the Twitter card type that matches the site's content. Decide which social image field editors will fill and what happens when it is empty. The step is done when the page source of a sample page contains og and twitter meta elements with values that match the intended content.

  5. Set canonical URL behavior

    Configure the canonical URL pattern so that each page points to one preferred address, and confirm how it interacts with URL aliases, query parameters and any translated paths on the site. Work with the team responsible for redirects and aliases, because a canonical that points to a path that redirects will send mixed signals. The step is done when pages with and without query strings or aliases each output a canonical link element that points to the same preferred URL.

  6. Verify rendered head tags on sample pages

    Using a browser, the team opens view-source on a representative page from each content type and checks the title, description, canonical, Open Graph and Twitter tags against the agreed values. They then run the public URL through the platform debuggers offered by the social networks the organization cares about, and fix any missing image or card type. Document the results in a short checklist kept with the site. The step is done when every sample page passes both the source review and the debugger check.

  7. Confirm caching and release behavior

    Because head tags are often cached, the team checks that a change to a pattern or default appears on rendered pages after the caches are cleared, and that the same tags are served to logged-out visitors through any reverse proxy or CDN in front of the site. Ask the hosting team to confirm how cache purging is triggered on your environment. The step is done when a test pattern change appears on the public page within the site's documented cache behavior and the release process includes this check.

What changes during a Drupal 7 migration or multilingual rollout

Metatag settings on a Drupal 7 site do not carry over to a new Drupal 10 or 11 site. Drupal 6 and 7 sites cannot simply be updated to a current version. They are migrated into a new site with the core Migrate, Migrate Drupal and Migrate Drupal UI modules or with Drush, and themes must be rebuilt. The default patterns, per-content overrides, token usage and Open Graph settings you rely on today have to be recreated and checked on the new site. Treat the metadata model as part of the migration scope, not as a leftover from the theme work. Confirm with your migration partner which Metatag configuration, if any, is mapped by the migration and which is rebuilt by hand, and record that decision in the statement of work.

Plan the metadata patterns before any content is moved. Export the current default and per-entity values for titles and descriptions, group them by content type, and decide which fields become tokens and which stay as editor-entered values. Then map each old value to its new destination field, and sample pages across every content type and language to compare what the old site rendered with what the new site renders. Titles and descriptions that were hand-written on high-traffic pages deserve a line-by-line review, because token patterns will not reproduce them. Set aside time for editors to check exceptions, since migrated text is often truncated or missing where the old field had a different length or input format.

Multilingual rollouts add a second layer. Each translation needs its own title, description and Open Graph values, and an empty translated field should fall back to a deliberate default rather than to the source language without review. Decide early whether translated metadata is entered by translators, generated from tokens in each language, or left to editors, and confirm how the language negotiation and translated URL aliases on your site affect the canonical URL each version outputs. Redirect planning and hreflang output are covered on the sibling pages on Drupal redirects and SEO during migrations and on Drupal multilingual SEO with hreflang, so align those decisions with this metadata map before launch.

Security and operational considerations for metadata

Metatag output is public, and it changes whenever a pattern or a single node changes. The four cards below cover the risks that most often surface after launch, from editor-entered canonical URLs to the update rhythm that keeps the module itself current. Each one needs an owner and a check before the configuration goes live.

Incorrect canonical overrides

Metatag lets editors set a canonical URL on individual nodes, and a wrong value tells search engines to index a different page or to drop this one. A typo, a staging hostname or a link to a filtered listing can quietly consolidate signals away from the page you meant to rank. Restrict who can edit the canonical field, validate that it resolves to a public, absolute URL on the production domain, and review canonical tags in a crawl after each template change.

Leaking draft and internal data

Tokens such as the title, summary or a custom field can pull unpublished content, internal notes or editor-only text into public <meta> tags and social preview cards. Drafts and revisions can expose data before the page is visible to anyone else. Review which tokens feed each tag, confirm that unpublished and access-restricted entities render no metadata, and test the rendered source of a logged-out request.

Pattern changes that reach many pages

A default pattern applies to every entity of a type that does not hold its own override, so one edit can rewrite thousands of titles and descriptions in a single save. Treat pattern changes like code: write them down, preview the result on a sample of nodes, and schedule them with a crawl comparison before and after. Ask your partner or internal team to document the rollback steps for each pattern set.

Release cadence for Metatag and core

Drupal core ships bugfix releases on the first Wednesday of each month and security releases on the third Wednesday, so your update window should follow that calendar rather than an ad hoc schedule. Metatag and its dependencies are contributed projects that need the same tested path through staging before production. Track advisories for every installed module, record the version in your deployment notes, and confirm that your configuration export survives each update.

Questions teams ask before configuring Metatag

What drives the cost and effort of Metatag configuration?

The main driver is how many content types, bundles, languages and special page types the site has, because each one needs its own defaults and token patterns. Effort also rises with the number of fields that editors can override per item, the number of social platforms and image sizes you want to support, and how much existing content needs a review after the defaults change. Cost is paid for analysis of your content model, configuration and testing, and documentation for editors. Ask any partner to break the quote into those components so you can see which parts scale with your site and which are one-time.

How long does Metatag configuration usually take?

Duration depends mostly on the number of content types, languages and templates that need distinct metadata, not on the module itself. A site with a few stable content types and one language is a much smaller job than a multilingual estate with custom entities, landing pages and separate social image rules. Ask for a timeline that lists each content type, the review step for each, and the point where editors confirm the output. Because no figure has been supplied for this topic, treat any duration you are given as a proposal to test against your own content inventory.

What does the work need from our content and SEO owners?

The configuration needs decisions from people who own the content and the search results, not only from developers. The SEO owner should agree on title and description patterns, how canonical URLs behave for filtered or paginated listings, and which pages must be excluded from indexing. Content owners should confirm which fields editors write by hand, what fallback text is acceptable, and which images represent each content type on social platforms. Expect a short review cycle where sample pages are checked against those decisions before the defaults are applied across the site.

Can our in-house team configure Metatag without a partner?

Yes, a capable Drupal team can install and configure Metatag internally, and the module is free to use. The work is mostly site-builder work: defining tokens, setting global and entity-level defaults, and testing output. The risk is less about technical skill and more about time and consistency, especially when several people edit patterns across many content types. Teams that lack a reviewer for SEO decisions or that need to validate output across languages often bring in outside help for the design and review stages. Compare the internal time required with the cost of a fixed-scope engagement, using the written scope as your baseline.

Is the Metatag module a licensing cost?

No. Metatag is a contributed module hosted on Drupal.org and is licensed under GPL-2.0-or-later, the same license that covers Drupal core. There is no paid edition of the module or of Drupal itself, so the licensing line in your budget should be zero for the module. Costs you will still see are for the people who configure, test and maintain it, plus any hosting or third-party services you add for previews or validation. Confirm the license terms on the project page before you rely on them in procurement documents.

How do we verify metadata changes after launch?

Verification combines a rendered-output check with a scheduled review of live pages. After each change, sample pages from every content type and language should be inspected for the title, description, canonical link and Open Graph and Twitter Card tags in the page source. Social preview tools and search console reports can then confirm that platforms and crawlers read what you expect. Operations teams should also watch for pages where a token resolved to an empty value, because that is the most common silent failure. Ask your partner to document the checklist and the owner for each check so the process survives staff changes.

What breaks most often in Metatag setups?

The most frequent problems are tokens that return empty values, duplicate titles across similar pages, and canonical URLs that point to the wrong version of a page, especially with aliases, filters or language prefixes. Overrides can also drift: an editor sets a custom description on one node and the pattern no longer reaches it after a later change. Engineers should test with real content from each bundle, check that aliases and language settings match what the canonical tag expects, and confirm that changes to default patterns do not silently overwrite values editors have already entered. Keep a short test set of URLs so every release is checked against the same cases.

How DeployOpen scopes and delivers Metatag work

DeployOpen plans and builds Drupal Metatag configuration as part of a written, fixed-scope engagement inside the client's own infrastructure. We agree the defaults, token patterns, content types and social sharing rules in writing before work starts, then build, test, document and hand the configuration over to the team that will run the site.

How we scope

  • We list every content type, view and landing page that needs a default title, description and canonical rule.
  • We agree which Open Graph and Twitter Card fields each content type needs, with image sources named.
  • The written scope states which Metatag patterns, overrides and tests are included, and which are excluded.

How we build

  • We configure site-wide defaults and token patterns for each content type, then add per-content overrides only where the editorial need is documented.
  • We check rendered head tags on sample pages for each template, covering canonical, robots and social preview output.
  • We record token fallbacks for empty fields so untitled or unsummarized content still produces usable metadata.

How we hand over

  • We deliver a written map of patterns, tokens, overrides and the owner of each setting, kept in your repository.
  • We provide a test checklist your editors and developers can rerun after each release or new content type.
  • We train the people who will maintain the configuration, and we confirm access and change control with your team before closing the work.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer, scoped separately from the build.
  • A retainer can cover Metatag module updates, pattern changes for new content types and periodic checks of rendered output.
  • Before any support work begins, we confirm the scope, response expectations and change process in writing.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.