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?

+3


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

0


source


A bit necro, but for that <p>

you can add a class or perhaps another property.

eg



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

will not be stripped (using Gutenberg).

0


source







All Articles