How can I remove p tags that are auto added within tinymce

Juan Gonzales picture Juan Gonzales · Jun 29, 2013 · Viewed 51k times · Source

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 into the editor.

Answer

turco_7 picture turco_7 · Sep 10, 2013

you need to add the following line to your init statement

forced_root_block : ""

So, your complete code will be like this:

    <script>tinymce.init({forced_root_block : "",selector:'textarea'});</script>