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
Insert in theme functions.php the following code:
add_filter('tiny_mce_before_init', 'my_switch_tinymce_p_br');
function my_switch_tinymce_p_br($settings) {
$settings['forced_root_block'] = false;
return $settings;
}
If you want replace root "p" tag with some else, replace false with "div" (for example).