Removing <p> and <br/> tags in WordPress posts

Viewed 89578

Whenever I am posting some content in WordPress post page it is showing some paragraph tags like <p> and <br/>. Which is showing some extra space in output. So is there any solution for it? How to remove all the tags?

10 Answers

By default, WordPress adds paragraph <p></p> tags to category descriptions. Stop this by adding the following to your functions.php file

// Remove p tags from category description
remove_filter('term_description','wpautop');

Simple and easy (codeless).

Thank you

in case you want to remove p tag in Wordpress post or textarea without a change in function, you can do a simple css-trick like : css :

.container >p {
display:none;
}

html:

<div class = 'container'>
<!the p tag u dont want here!>
</div>
Related