I am using tinymce 4.0.1 and it automatically adds p tags when you either start typing or hit enter. How can I dynamically remove these p tags and then reinsert the content
Can you simply tweak what TinyMCE puts into the database when you display it? See my post for the same thing for Rails.
var str = "{TinyMCE HTML string}"; /* however you get it */
str = str.replace(/^\/,"").replace(/\<\/p\>$/,"");
Here you are removing the beginning and ending p tag of the whole TinyMCE HTML when you display it. Doesn't mess with other p tags or the TinyMCE config.
Explanation of the regex expression (removed \'s for ease of reading):
^ - find
at the start of the string (^) and replace it with nothing.
$ - find at the end of the string ($) and replace it with nothing.
Hope this helps.