CKEditor inserts extra <p> tags when users enter a newline.

How do I disable this automatic paragraph tag?


You need to modify these settings to CKeditor.

// The writing rules for the <p> tag.
writer.setRules( 'p', {
// Inserts a line break after the <p> opening tag.
        breakAfterOpen : true,

This can either be set programmatically, via JS or I believe you should be able to add it directly via the UI, if you visit the Ckeditor settings page, there should be a box where you can enter ckeditor settings.

For more info see ckeditor docs: https://docs-old.ckeditor.com/CKEditor_3.x/Developers_Guide/Output_Formatting


Edit the Text format your users use and disable the option that turns new lines into paragraphs or breaks.

You can find the Text formats under Configuration > Content authoring > Text formats and editors.

When you edit the one your users are using you will see that option enabled, you have to disable it:

CKeditor options Text formats

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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