Answer the question
In order to leave comments, you need to log in
How to disable automatic page editing in WP?
Hello. The bottom line is this: I have a record where I insert the layout in the code editing mode. After switching to the visual editor, WP itself adds closing tags to the code. How to remove it?
this did not help
remove_filter('the_content','wptexturize'); // Disable auto-formatting in full post
remove_filter('the_excerpt','wptexturize'); // Disable auto-formatting in the short(announcement) post
remove_filter('comment_text', 'wptexturize'); // Disable auto-formatting in
Answer the question
In order to leave comments, you need to log in
You can get rid of
adding a p-tag with the following snippet in the functions.php of the theme:
function disable_wp_auto_p( $content ) {
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
return $content;
}
add_filter( 'the_content', 'disable_wp_auto_p', 0 );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question