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)