wordpress 6.7 upgrade – remove wpautop
wordpress 6.7 upgrade – remove wpautop
wordpress 6.7 upgrade – remove wpautop
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.
Take a better look at the arguments that this functions accepts: wp_link_pages(array( ‘before’ => ‘Pages’, ‘after’ => ”, ));
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
yes, you can deactivate the autop for shortcode via filter add_filter( ‘the_content’, ‘shortcode_unautop’ );
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
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.
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
You can achieve this much easier with css (escpecially for wp-ers who dont have access to edit plugins): <style> p:empty{ height: 0; margin: 0; padding: 0; } </style>
get wpautop to not wrap tags but only text