Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

CKEditor 5 Paste Filter

16,486 sites Security covered Drupal 9–11
View on drupal.org

This module cleans up content pasted into CKEditor 5 from sources like Microsoft Word and Google Docs. It provides a customizable set of filters, which can be configured within Drupal's text format settings to match your specific needs.

Clean up the markup of content pasted into CKEditor 5 from Microsoft Word, Google Docs, and other rich text sources. Comes with a pre-configured set of filters but fully customizable.

Paste filters can be customized via the text format user interface. Filter configuration is stored as part of the text format configuration, so you can have different sets of filters for different text formats if you wish.

Usage

First, install this module as you normally would.

To configure and start using it, follow the steps below.

  1. Add or edit a text format (/admin/config/content/formats)
  2. Set the 'Text editor' of the text format to CKEditor 5
  3. Under 'CKEditor 5 plugin settings' select the 'Paste filter' vertical tab
  4. Enable the plugin by checking the 'Filter pasted content' checkbox
  5. (Optional) Add/edit/remove the pre-configured filters if you have different filtering requirements:
    • To add filters, click the "Add another filter" button inside the Paste filter configuration form
    • To remove filters, empty the search and replace text boxes, the filters will be removed after saving the text format
  6. Save the text format: Scroll to the bottom and click "Save configuration"

Context

This module allows filtering (searching and replacing) using a set of regular expressions. Each filter consists of a search expression and a replace expression. If your use case is a common one, then you don't need to know regular expressions, just install and configure the module as described above.

Drupal core ships with a CKEditor 5 plugin which filters out some of the markup from these sources but does not go as far as the CKEditor 4 "Paste from Word" functionality. Note that this module's default set of filters is more aggressive than the CKEditor 4 "Paste from Word" functionality.

Similar Projects

This is a CKEditor 5 version of CKEditor Paste Filter with additional features, most notably that the filters are fully configurable via a form interface and the filters can be configured individually for each text format. This module has been created as a separate project so that sites transitioning over to CKEditor 5 can have both modules installed easily, and to allow this project to evolve without needing to maintain compatibility with both CKEditor 4 and 5.

CKEditor5 Custom Paste - This module has not been tested by the maintainers of this project but may be a better fit for some use cases, or may even be complementary to this project in some cases. Note that as of this writing there is no automated test coverage for this other project.

Depends on

Dependencies of the latest stable release

  • ckeditor5 Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Feb 2025
Latest release
8 months ago
Releases (12 mo)
1 ▼ from 2
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.1.1 Stable 9–11 Dec 10, 2025
1.1.x-dev Dev 9–11 Feb 26, 2025
1.1.0 Stable 9–11 Feb 26, 2025