I have a problem with the wordpress editor. It keeps removing my enters and scrambling the content. How can I solve this problem?

Error in editor

  • which version of wordpress you are using?
    – Ramkumar M
    Commented Jun 30, 2011 at 10:59
  • Last one (3.1.4). I always keep it up to date.
    – Jarco
    Commented Jun 30, 2011 at 18:05

1 Answer 1


I'd suggest using editor style for your wysiwyg. Add add_editor_style(); to your functions.php and then add a new file called editor-style.css to your main theme directory. Your editor style should reflect the basic css settings like your actual frontend content width, H1, H2, p etc tags styles, margins, image padding adn margins etc. Don't copy your default style.css, only the basic styling.

Here is an example of an editor-style.css file I used on my latest project (note html .mceContentBody):

html .mceContentBody {
font-family:Arial, Helvetica, sans-serif;

h1 {
    color: #AC2327;
    display: block;
    font-size: 16px;
    font-weight: bold;
    line-height: 50px;
h2 {
    color: #494949;
    font-size: 14px;
    font-weight: bold;
    margin: 10px 0 15px;
ul li {
    color: #494949;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.7em;
    list-style: disc inside url(includes/images/dot.gif);
    padding: 2px 0;
p {
    color: #494949;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.6em;
    margin: 15px 0 5px;
p a {
    color: #CA1016;
    text-decoration: none;
strong {
    font-weight: bold;
img {
    border: 1px solid #E4E2E2;
    clear: both;
    margin: 0 25px 25px;
hr {
    background-color: #D7D7D7;
    border: 0 none;
    color: #D7D7D7;
    float: left;
    height: 1px;
    margin: 0 0 18px;
    width: 100%;
  • Great. Exactly what I needed. Changing the how it is needed to resemble the front page.
    – Jarco
    Commented Jun 30, 2011 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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