• Hi all,

    i’m working on a site and wish to stop those damn “P tags” getting added to the content.

    so far i have tried:

    installing wpautop plugin <— this did nothing

    I added this code to function.php:

    remove_filter( ‘the_content’, ‘wpautop’ );
    remove_filter( ‘the_excerpt’, ‘wpautop’ );

    <— this did nothing

    then i tried adding this code to function.php:

    function simonbattersby_shortcode_format($content){
    $content = preg_replace('/(<p>)\s*(<div)/','<div',$content);
    $content =  preg_replace('/(<\/div>)\s*(<\/p>)/', '</div>', $content);
    return $content;
    }
    
    add_filter('the_content','simonbattersby_shortcode_format',11);

    <— this did nothing

    my only solution is to use “raw html” block instead of a “text block”

    this problem has been around waaay too long, seriously.

    this image may help explain https://homesearchproperties.com/wp-content/uploads/2020/08/Screenshot-hsp.jpg

    any help? please?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Removing P tags (so annoying)’ is closed to new replies.