Drupal 11 Metatag: Use the Body Field When Summary Is Empty (No Custom Code)

One of the most common SEO challenges in Drupal is generating a meaningful meta description when editors leave the Summary field empty.

Many Drupal site builders expect the Metatag module to automatically use the Body field or generate an excerpt from the first paragraph. Surprisingly, it doesn’t.

This article explains the limitation, why it happens, and a practical workaround that requires no custom code.


The problem

Suppose your Article content type contains only:

  • Body
  • Image
  • Title

Editors usually write content directly in the Body field and ignore the Summary.

A common Metatag configuration is:

[node:summary]

Unfortunately, if the Summary field is empty, Drupal outputs an empty value.

As a result:

<meta name="description" content="">

This is not ideal for SEO or social sharing.


Why doesn’t Drupal generate a summary automatically?

This behavior often causes confusion.

Drupal does generate an automatic summary in some places, such as:

  • Teaser view mode
  • Certain field formatters

However, the Metatag module uses Tokens, not field formatters.

The Token system simply reads the stored Summary value.

If the Summary column in the database is empty, the token returns nothing.

In other words:

Body field
        │
        ├── Value
        └── Summary

[node:summary]
        │
        ▼
Only reads the Summary column

No automatic fallback occurs.


Common solutions that do not work

Many administrators try variations such as:

[node:summary|node:body]

or

[node:body:summary]

or

[node:body:value:trimmed]

Unfortunately, these do not provide the expected fallback behavior in Drupal 11 Metatag.

Likewise, installing the Smart Trim module does not solve the problem because Smart Trim is a field formatter, not a Metatag token processor.


A practical workaround using the Body field

After testing Drupal 11 with the latest Metatag and Maxlength modules, we found a simple solution.

Instead of using:

[node:summary]

configure the Description tag to use:

[node:body]

Then enable trimming using the Maxlength module.


Recommended Maxlength settings

Enable: Use Maxlength module to force these limits

drupal-metatag-trimming-options

Recommended values:

SettingValue
Meta Tags: Description160
Meta Tags: Abstract160
Meta Tags: Open Graph Description160
Meta Tags: Twitter Description160

Trimming options:

  • Trim before the word: Enabled
  • Optional suffix: Leave blank

Optimized settings and rendered output

drupal-metatag-trimming-options-optimized drupal-metatag-trimming-options-source-code


The result

Instead of generating an empty description:

<meta name="description" content="">

Drupal outputs a clean description based on the beginning of the Body field.

The Maxlength module trims the text at a word boundary, producing a readable SEO description without requiring editors to manually enter a Summary.

This approach also works consistently for:

  • Meta Description
  • Abstract
  • Open Graph Description
  • Twitter Card Description

A limitation discovered during testing

One exception was found.

The following tag was not trimmed by Maxlength:

<meta name="dcterms.description">

While:

  • description
  • abstract
  • og:description
  • twitter:description

were all trimmed correctly.

Since Dublin Core metadata is rarely used by modern search engines, this limitation has little practical SEO impact.


Is using the Body field good for SEO?

Yes, provided your content follows good writing practices.

Every article should begin with a concise introductory paragraph that summarizes the topic.

That opening paragraph becomes:

  • the first content users read
  • the content most likely to appear in search snippets
  • the source of your meta description

This aligns well with modern content writing recommendations.


Best practices

For Drupal 11 corporate or government websites:

  • Use descriptive page titles.
  • Write a strong introductory paragraph.
  • Use [node:body] for Description if Summary is rarely used.
  • Enable Maxlength trimming.
  • Configure Open Graph and Twitter descriptions to use the same token.
  • Disable the Generator meta tag.
  • Remove unnecessary metadata such as Dublin Core Description if not required.

When should you use the Summary field instead?

If your editorial team consistently writes SEO-friendly summaries, continue using:

[node:summary]

The Summary field gives editors complete control over search snippets.

However, if summaries are rarely populated, the Body field with Maxlength provides an effective no-code alternative.


Conclusion

Drupal’s Metatag module does not automatically fall back from the Summary field to the Body field when generating meta descriptions. This is a limitation of how the Token API works rather than a bug in Drupal itself.

A practical workaround is to configure Metatag to use the Body field and enable trimming with the Maxlength module. This approach produces consistent, SEO-friendly descriptions without requiring custom code or additional editorial effort.

For organizations where editors primarily work in the Body field, this configuration offers an excellent balance between automation, maintainability, and search engine optimization.


Key takeaways

  • [node:summary] returns an empty value if the Summary field is empty.
  • Metatag tokens do not automatically fall back to the Body field.
  • Smart Trim does not affect Metatag output.
  • [node:body] combined with the Maxlength module, it provides a practical workaround.
  • Configure Maxlength to trim descriptions to approximately 160 characters at word boundaries.
  • Test the generated HTML to confirm your metadata appears as expected.

This approach has proven to be a practical solution for Drupal 11 sites where the Summary field is available but not consistently used by content editors.