Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to remove p tag and br tag in default wordpress editor

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 551
    Comment on it

    Hello readers, today I will guide you to "remove <p> tag and <br> tag in default WordPress editor in admin panel".

    In WordPress editor its a default functionality to add <p> tag and <br> tag. While creating a new post, every new post have a title, description and featured image(optional). We can set the title like My first post and their description. In post description there will be some content which we can put into the editor and publish the post. But the WordPress editor add auto <p> tag and <br> tag.

    Sometime we can put HTML into editor and when we see this post into browser their are extra <p> tag in our HTML.

    So the below code remove the extra p and br tags into editor with the help of remove_filter() function.

    The below function remove the p and br tags in the contentr.

    remove_filter( 'the_content', 'wpautop' );
    

    The below function remove the p and br tags in the excerpt.

    remove_filter( 'the_excerpt', 'wpautop' );
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: