I know there is "Paste Text" button in CKEditor, and I can limit allowed HTML tags.
But it's very hard to explain clients to use specific button when they insert text.
As result they often insert "dirt" texts with HTML tags.

As I remember there was setting in early versions of CKEditor to force insert plain text by default but cannot find it in current version.

Is there any solution for the problem?

UPDATE: I don't want to restrict user to use some tags. But user should get "clean" plain text without HTML tags when insert text.

  • By insert, do you mean typing or 'regular' pasting? For me insertion is typing, but if no HTML is allowed, ckeditor makes no sense. Sep 14, 2020 at 3:50
  • By insert I mean paste (ctrl-V). HTML is allowed. I don't want to restrict user to use some tags. But user should get "clean" plain text when insert it. I would like ctrl-V works as "Paste Text" button by default.
    – Dimetry
    Sep 14, 2020 at 4:01

3 Answers 3


You want to change the ckeditor configuration to always paste as plain text.

This defined in https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-forcePasteAsPlainText

It comes down to the following JavaScript configuration:

// All content will be pasted as plain text. 
config.forcePasteAsPlainText = true;

Have a look here for where to set it Is there advanced configuration for CKEditor in Drupal 8?

  • Many thanks. It really helped. If you refer to CKEditor custom config module I'll accept it as answer.
    – Dimetry
    Sep 16, 2020 at 9:33
  • I deliberately did not because there are apparently multiple methods to get the config working. Therefore the other topic provides a more complete overview of the options. Sep 16, 2020 at 9:35

Eventually I used module CKEditor custom config and set in custom configuration: forcePasteAsPlainText = true


You can use the Drupal module Paste Format to force pasting as plain text.

Two notes:

  1. The original module is for Drupal 7. But in the issues is a module and hints for Drupal 8||9. The link above goes directly to this issue.
  2. This module only works for CKEditor 4 and therefore is not suitable for CKEditor 5 shipped with Drupal ^10. But it could work with the contributed module CKEditor 4 (not tested).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.