CKEditor Allowed Content Rules allows you to override Drupal default "Limit allowed HTML tags and correct faulty HTML" editor rules with more advance CKEditor Allowed Content Rules.
How to use
- Navigate to an editor configuration page (/admin/config/content/formats/manage/[editor]).
- Ensure you have enabled "Limit allowed HTML tags and correct faulty HTML" filter for this setting to take effect.
- On the configuration page, navigate to "CKEditor Allowed Content Rules Override" under "CKEditor plugin settings". Override rules with each item on its own line.
Example configuration
// A rule accepting <a> only if it contains the "href" attribute.
a[!href]
// A rule accepting <img> with a required "src" attribute and an optional
// "alt" attribute plus optional "width" and "height" styles and an optional
// class name.
img[alt,!src]{width,height}(className)Supporting organizations:
Project information
- Project categories: Content editing experience, Content display, Developer tools
24 sites report using this module
- Created by bunty badgujar on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.

