php – WordPress editor add and remove tag<p> . How to turn it off?


The editor automatically adds p tags
To include this in the page template added

remove_filter( 'the_content', 'wpautop' ); // Отключаем автоформатирование 

the_content(); ?>

But now, when switching between the "Visual" and "Text" tabs, the p tags are removed.

How can I disable both auto-adding and auto-removing p tags for a page template?


Add this code not to the page template, but to functions.php

Scroll to Top