Don't want my WordPress editor to remove tags and <p>

I do not want my editor WP delete tags br

and p

when you save, and I do not want to install TinyMCE to achieve it. Just use the tags br

and p

the default editor WP.

Is there a good way?


source to share

2 answers

there are smoother plugins, but you can just add these lines to functions.php

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );


See more here



A bit necro, but for that <p>

you can add a class or perhaps another property.


<p class="nothing-relevant">Foo</p>

will not be stripped (using Gutenberg).



All Articles