Text format

Text formats such as Basic HTML or Full HTML are the per-role choices under a formatted text field that control which markup reaches the page.

Learn DrupalDrupal glossary Last updated

A text format is a saved configuration that decides how text typed into a formatted field is processed and displayed. It lists the filters that run, in a set order, and the roles allowed to use it. It can also be paired with an editor such as CKEditor 5. Drupal stores the text as typed and applies the format only when the text is shown.

How text formats work in Drupal 11

A text format is a configuration entity of type filter_format, saved as filter.format.[machine name]. You manage formats under Configuration › Content authoring › Text formats and editors (/admin/config/content/formats). Creating and editing formats needs the administer filters permission.

Each format carries three settings:

  • Roles. Every format except the fallback has its own permission, use text format [machine name]. Roles that hold it can pick that format on content forms.
  • Filters. A filter adds, removes or transforms parts of the text. The Drupal help text says filters run from top to bottom, so the order matters: converting URLs into links before disallowed tags are removed can strip all links.
  • Editor. The Text Editor module can attach an editor to a format. Core ships CKEditor 5 for this; see WYSIWYG.

Core provides Plain text, which is the fallback format and shows any HTML as plain text. The Standard installation profile adds three more: Basic HTML (for authenticated users, with CKEditor 5), Restricted HTML (for anonymous users) and Full HTML (for administrators, with CKEditor 5). Only fields of a formatted text type use formats, for example Text (formatted, long). On the editing form, a Text format list below the field lets users choose. Formats appear in the order set on the overview page, and the first one available to the user is preselected.

Example

To allow a horizontal rule in Basic HTML, open the Text formats and editors page and click Configure next to Basic HTML. Drag the horizontal line button from Available buttons to the Active toolbar and save. With CKEditor 5, the allowed-tags list of the Limit allowed HTML tags and correct faulty HTML filter follows the enabled toolbar items, so the <hr> tag is added for you.

Common mistakes

  • Offering Full HTML to untrusted roles. The Filter help says anonymous and untrusted users should only get formats that restrict them to plain text or a safe set of tags, because HTML can carry malicious links or scripts (XSS).
  • Trying to type a tag into the allowed-tags list of a CKEditor 5 format. The CKEditor 5 help says that field is read-only and follows the enabled plugins. Enable the plugin that provides the tag, or list it under Manually editable HTML tags in the Source editing settings.
  • Reordering filters without testing. The URL example above shows how one filter can undo another.

For marketing and content teams

When a field offers a choice of text formats, use the one your team agreed on and leave it alone. If a tag you typed in the Source view disappears when you switch back, the format does not allow it. The CKEditor 5 help says tags without a matching editor plugin are stripped at that moment. Ask your developer to enable the matching button rather than switching to Full HTML.

Sources

Questions about Text format

The one your site assigns to their role. In the Standard profile, Basic HTML is set for authenticated users and Full HTML for administrators only. The Drupal docs warn that Full HTML does not restrict tags, which they call a severe security risk for untrusted users.

Open the field's settings and use Allowed text formats. If you select none, every format available to the user is offered. Use it when a field, such as a short teaser, should only accept a restricted format.

No. Drupal stores the text as typed and runs the filters when it is displayed. Switching to a stricter format hides disallowed tags in the output, but the original text stays in the database.

Plain text is the fallback format, set in filter.settings. Every site needs one that all users can access, so the Text formats page offers no Disable link for it, and code that tries to disable it throws an exception.

Cite this definition

"Text format." DXPR Drupal glossary, https://dxpr.com/hc/documentation/learn-drupal/drupal-glossary/text-format. Last updated October 26, 2026.

Related terms

All Drupal terms from A to Z