Advertising sustains the DA. Ads are hidden for members. Join today

Installing and Configuring Maxlength

Last updated on
30 August 2021

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

Installation

Install the Maxlength module using the standard installation method for contributed modules.

Once installed, be sure to enable the module.

Configuration

Once Maxlength is installed and enabled, assign the module-provided Bypass maxlength setting permission to the intended user roles. Note that this will hide the character count text from fields for user roles with that permission.

Screenshot of Maxlength permission on permissions page.

Next enable Maxlength for the intended fields. You can apply a maximum length to the following field types:

  • Text (formatted)
  • Text (formatted, long)
  • Text (formatted, long, with summary)
  • Text (plain)
  • Text (plain, long)

Navigate to the Manage fields page of the intended entity. For example, Structure > Content Types > Article > Manage fields (/admin/structure/types/manage/article/fields)

Click the edit link next to the field you want to set a maximum length to.

Screenhot of field settings provided by Maxlength.

Maxlength provides the following configuration options:

  • The maximum number of characters allowed
  • The countdown message, including tokens for character limit, characters remaining, and characters used.
  • Force text truncate
  • Truncate HTML

WYSIWYG Compatibility

Maxlength is compatible with tinyMCE and CKEditor.

Help improve this page

Page status: No known problems

You can: