CKEditor 5 select all

This project is not covered by Drupal’s security advisory policy.

Adds the Select All feature to CKEditor 5 in Drupal. A toolbar button and the Ctrl/Cmd + A keyboard shortcut let editors select all content inside the editor in one action — making it easy to copy, replace, or clear the entire content of any CKEditor 5 field, without selecting anything outside the editor widget.

Why You Need This Module

By default, pressing Ctrl/Cmd + A inside a CKEditor 5 field
triggers the browser's native select-all behaviour — selecting everything on
the page, including menus, sidebars, and other fields. This is frustrating for
content editors who simply want to select and replace or copy the text in a
single editor field.

This module solves that problem by scoping the Select All action to the focused
editor instance only. It is particularly useful in the following situations:

  • Replacing all content — select everything in the editor with one keystroke, then start typing to replace it instantly.
  • Copying all content — copy the full body of a node or paragraph field without accidentally grabbing surrounding page elements.
  • Deleting all content — clear an entire editor field in one step: Select All, then Delete.
  • Formatting all content — select everything before applying a style, alignment, or other toolbar formatting to the whole document.
  • Accessibility — keyboard-first editors can select all content without reaching for the mouse.
  • Consistent behaviour — gives editors a predictable, browser-independent way to select all text regardless of OS or browser quirks.

Features

  • Toolbar button — drag the Select All button into any CKEditor 5 toolbar via the standard Drupal text format UI.
  • Keyboard shortcutCtrl + A (Windows / Linux) or Cmd + A (macOS), scoped to the editor only.
  • Zero configuration — no settings form, no YAML to edit, no extra libraries to download. Enable the module, place the button, done.
  • Pure YAML plugin — implemented as a YAML-only CKEditor 5 plugin definition with no custom PHP class required, following Drupal core best practices.
  • Full test coverage — nine kernel tests verify plugin discovery, toolbar item registration, library declaration, config schema validity, and round-trip editor persistence.
  • Drupal coding standards — PHPCS (Drupal + DrupalPractice) and PHPStan level 5 clean.
  • Drupal 10 and 11 compatible — requires core ^10 || ^11.

Requirements

  • PHP 8.1 or higher
  • Drupal core 10 or 11
  • CKEditor 5 module (bundled with Drupal core — no separate install needed)
  • No JavaScript build step required

Installation

Composer (recommended)

  1. Run: composer require drupal/ckeditor5_select_all
  2. Enable: drush en ckeditor5_select_all && drush cr

Manual

  1. Download the latest release from the project page.
  2. Extract to web/modules/contrib/ckeditor5_select_all/.
  3. Enable via Admin › Extend or run drush en ckeditor5_select_all.

Configuration

No module-level configuration is needed. The only step is placing the toolbar button on a text format.

  1. Go to Admin › Configuration › Content authoring › Text formats and editors.
  2. Click Configure next to the text format you want to update (e.g. Basic HTML or Full HTML).
  3. In the CKEditor 5 toolbar drag-and-drop area, find Select All in the Available toolbar items section.
  4. Drag it into your active toolbar row at the desired position.
  5. Click Save configuration.

The button is immediately available to any user with permission to use that text format. No cache rebuild is required after saving.

Usage

Action Result
Click the Select All toolbar button Selects all content inside the editor
Ctrl + A (Windows / Linux) Selects all content inside the editor
Cmd + A (macOS) Selects all content inside the editor

The selection is scoped to the editor widget. Pressing Ctrl/Cmd + A does
not trigger the browser's default select-all behaviour on the
page — it only selects content within the focused CKEditor 5 instance.

Demo

  1. Visit simplytest.me/project/ckeditor5_select_all and click Launch Sandbox.
  2. Install Drupal as normal and enable the CKEditor 5 Select All module.
  3. Go to Admin › Configuration › Content authoring › Text formats and editors and configure any CKEditor 5 format (e.g. Full HTML).
  4. Drag the Select All icon into the active toolbar and save.
  5. Create or edit any content using that format — click the toolbar button or press Ctrl/Cmd + A to instantly select all editor content.

Contributing

Contributions are welcome via the issue queue on drupal.org.

Support

Please post bug reports, feature requests, and support questions to the
CKEditor 5 Select All issue queue.

Supporting organizations: 

Project information

Releases