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.
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
- Drupal User Guide: Concept: Text formats and editors
- Drupal User Guide: Configuring text formats and editors
- Drupal.org: Filter module overview
- Drupal core 11.4.8: Filter module help text (FilterHooks.php)
- Drupal core 11.4.8: FilterFormat config entity
- Drupal core 11.4.8: Plain text format and filter settings
- Drupal core 11.4.8: Standard profile Basic HTML format
- Drupal core 11.4.8: Standard profile Basic HTML editor
- Drupal core 11.4.8: Standard profile Restricted HTML format
- Drupal core 11.4.8: Standard profile Full HTML format
- Drupal core 11.4.8: Standard profile Full HTML editor
- Drupal core 11.4.8: Text field type settings (TextItemBase.php)
- Drupal core 11.4.8: CKEditor 5 help text (Ckeditor5Hooks.php)
Questions about Text format
Cite this definition
"Text format." DXPR Drupal glossary, https://dxpr.com/hc/documentation/learn-drupal/drupal-glossary/text-format. Last updated October 26, 2026.