CKEditor SDK

Advanced Content Filter – Automatic ModeDocumentation

Advanced Content Filter (ACF) is an important CKEditor core feature that filters incoming HTML content by transforming and deleting disallowed elements, attributes, classes and styles. By default it is enabled and works in automatic mode, which means that CKEditor will only accept content that was defined as allowed by enabled CKEditor features (such as plugins or buttons).

ACF is a highly configurable and powerful feature, so extensive documentation is available for it, too. The basics are explained in the Getting Started section of the "CKEditor Developer's Guide" and more advanced information is available in the Deep Dive section.

The following text will be used in each sample to show different filtering options:

A sample heavily formatted text using different fonts and text colors.

Automatic ACF Mode

In the sample below CKEditor works in automatic ACF mode (default behavior, requires no configuration):

Adjusting Automatic ACF Mode

It is possible to allow or disallow additional elements or properties in CKEditor by passing special configuration options: config.extraAllowedContent and config.disallowedContent.

In this example config.extraAllowedContent = 'u;span{color}' has the following consequences:

Disabling ACF

Turning ACF off is very simple and requires setting a simple configuration option: config.allowedContent = true. As a consequence, CKEditor will not filter entered content, including during paste operations.

Experiment by pasting content from various sources into the editor below and into the first one (with automatic mode on). Compare the results.

Related Features