The problem is that you delete the opening and closing closing tags before saving them in your database, which leaves the inconsistent html tags and therefore invalid html (... whenever you have more than one p block). In this way,
<p>Something</p> <p>Something else</p>
becomes:
Something</p> // invalid html - closing tag with no corresponding opening tag <p>Something else // invalid html - opening tag with no corresponding closing tag
CKEditor is actually trying to fix the wrong html for you when loading back to the editor.
If you do not need paragraph tags, I would suggest using the configuration option config.autoParagraph = false; and / or config.enterMode = CKEDITOR.ENTER_BR; (CKEditor will use <br /> instead of having the user enter a new line) only depending on your requirements.
Another possible solution would be to change your function before saving to search and replace all occurrences of '<p>' with '' and '</p>' with '<br />' , before permanently deleting any trailing '<br />' .
Steps to duplicate the problem:
a. You can go to http://sdk.ckeditor.com/samples/accessibilitychecker.html and click the Source button and paste the following:
<p>Something</p> <p>Something else</p>
C. Click Source and it will display this html correctly.
C. Press Source again to return to the original mode, and only 2 p will show
E. Remove the opening paragraphs and closing paragraph tags:
Something</p> // invalid html - closing tag with no corresponding opening tag <p>Something else // invalid html - opening tag with no corresponding closing tag
E Double-click Source to display the output, and then to see the adjusted source:
<p>Something</p> <p> </p> <p>Something else</p>