Contribute to this guide

Troubleshooting migration from CKEditor 4

This article describes some issues that you may encounter when migrating from CKEditor 4 to CKEditor 5.

# Why does the editor filter out my content (styles, classes, elements)? Where is config.allowedContent = true?

Unlike CKEditor 4, CKEditor 5 implements a custom data model. This means that every piece of content that is loaded into the editor needs to be converted to that model and then rendered back to the view.

Each kind of content must be handled by a dedicated plugin. For instance, the ckeditor5-basic-styles package handles HTML elements such as <b>, <i>, <u>, etc. along with their representation in the model. The feature defines the two–way conversion between the HTML (view) and the editor model.

If you load some content that is not recognizable to any of the editor features, it will be dropped. If you want all the HTML5 elements to be supported, you need to write plugins to support them. Once you do that and load these plugins into your editor instance, CKEditor 5 will no longer filter anything out.

You may also use the General HTML support functionality to enable HTML features that are not explicitly supported by CKEditor 5 plugins.

# What happened to the contents.css file? How do I style the content of the editor?

There is no such thing as the contents.css file anymore. This is because in CKEditor 5 the features bring their own content styles, provided via CSS files.

# Where are the editor.insertHtml() and editor.insertText() methods? How to insert some content?

Refer to this CKEditor 5 How-to question.

# What happened to the global window.CKEDITOR? How to list all instances of the editor?

Refer to this CKEditor 5 How-to question.