Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6385451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:54:04+00:00 2026-05-25T02:54:04+00:00

I am using ckeditor on my website to make it easier for users to

  • 0

I am using ckeditor on my website to make it easier for users to input HTML.

However, the data I get back from ckeditor is wrapped in <p></p> blocks. (Which I don’t want.)

Is there some configuration setting that forces the editor to not wrap the text in anything?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:54:04+00:00Added an answer on May 25, 2026 at 2:54 am

    Add the following to your config.js file for CKEditor:

    config.enterMode = CKEDITOR.ENTER_BR;
    

    Example:

    ...
    
    CKEDITOR.editorConfig = function (config)
    {
        config.enterMode = CKEDITOR.ENTER_BR;
    
        ...
    };
    

    Details

    The configuration setting that controls this behavior is based on what you want to happen when the user presses Enter.

    Just in case someone who’s new to working with HTML reads this, I’m including some basic explanation of the concepts involved and why a tag will need to be inserted when the Enter key is pressed.

    We know that if we enter some text into an HTML document and then put additional text on a new line, the browser won’t display the text as two lines, it will ignore any carriage returns and will condense multiple spaces between characters to a single space.

    The following HTML:

    qwer
    tyui
    

    Will be rendered as:

    qwer tyui

    So the editor needs to insert an HTML tag to tell the browser that it should display the second group of text on a new line.

    The configuration setting that controls this is config.enterMode and it offers three options:

    1 – Insert paragraph

    The default setting creates a paragraph element each time Enter is pressed:

    config.enterMode = CKEDITOR.ENTER_P; // inserts `<p>...</p>`
    

    2 – Insert ‘div’

    You can choose to create a div element instead of a paragraph:

    config.enterMode = CKEDITOR.ENTER_DIV; // inserts `<div></div>`
    

    3 – Insert break (the setting you’re looking for)

    If you prefer to not wrap the text in anything, you can choose to insert a line break tag:

    config.enterMode = CKEDITOR.ENTER_BR; // inserts `<br />`
    

    The CKEditor documentation indicates that using the ENTER_BR setting is not recommended:

    Note: It is recommended to use the CKEDITOR.ENTER_P setting because of its semantic value and correctness. The editor is optimized for this setting.

    Another related setting ‘autoParagraph’

    There is a second setting that controls a similar situation –config.autoParagraph. How it functions depends on the config.enterMode setting discussed above.

    autoParagraph determines whether inline elements such as span are wrapped in the block element (p or div) specified by the enterMode setting. The default is to wrap inline elements, so if you enter a span like this (as HTML):

    <span>asdfg</span>
    

    It will be wrapped in a p or div element like this:

    <p><span>asdfg</span></p>
    

    or this:

    <div><span>asdfg</span></div>
    

    The inline element won’t be wrapped if you set this to false or if you set enterMode to CKEDITOR.ENTER_BR.

    The CKEditor documentation includes this note about config.autoParagraph:

    Note: Changing the default value might introduce unpredictable usability issues.

    Even more settings

    There are three more settings that are somewhat related to this subject:

    • config.fillEmptyBlocks
    • config.forceEnterMode
    • config.ignoreEmptyParagraph

    Reference

    A complete list of the available configuration options can be found here:

    • CKEDITOR.config – CKEditor 3 JavaScript API Documentation
    • CKEDITOR.config – CKEditor 4 Documentation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings, I'm trying to prevent XSS and improper html from input fields using CKEditor
I'm using CKEditor and would like to be able to allow users to upload
I am using the CKEditor for my website along with PHP, and want to
I am Using CKEditor in my application where the users can write blogs, create
I am using CKeditor to allow users to add images to their textboxes in
I would like giving my users a limited editor, using the great CKEditor. I
iam using ckeditor in my website to add the content to the pages. But
I am using ckeditor in drupal and add some html tags in it like
I am using CKEditor in the backend of a website and stragely enought it
I'm using Ckeditor in my site to insert articles. The articles usually come from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.