How to disable auto-p in WordPress?

In your child theme’s functions.php, try something like this: remove_filter( ‘the_content’, ‘wp_autop’ ); Note that this may have unintended side-effects, and will definitely have an effect on how your content renders.

How do I format my custom html so wpautop won’t try to reformat it?

The function that does what I think you are referring to is wpautop(), probably the most complained about function is all of WordPress-dom. It is a filter on the the_content hook among others. You can remove that with: remove_filter(‘the_content’,’wpautop’); I would suggest that you spend some time looking through the many related questions to see … Read more

remove and then add wpautop

Well, removing autop filter from the_content filter tag makes no sense here, because you never apply the_content filters in your code… Let’s take a look at the source code of the_content() function: function the_content( $more_link_text = null, $strip_teaser = false) { $content = get_the_content( $more_link_text, $strip_teaser ); $content = apply_filters( ‘the_content’, $content ); $content = … Read more

WordPress remove filter wpautop not working

WP’s text widget doesn’t run text through the_content filter, it applies wpautop() on saved text explicitly in code: <div class=”textwidget”><?php echo !empty( $instance[‘filter’] ) ? wpautop( $text ) : $text; ?></div> This is controlled by aptly named “Automatically add paragraphs” setting at the bottom of the widget.

Remove p tags in wordpress posts

The WordPress implementation of the TinyMCE editor automatically adds <p> tags. There’s a few options for removing, as explained in a tutorial on removing <p> tags. I would recommend the following approach, which is a slight modification from that tutorial (as it involves messing with core wp functions). Add the following code to your functions.php … Read more