I have use WordPress filter but i can’t remove all extra <p></p>
tags.
This <p></p>
tags adding in last of page and post content.
But i want to remove all <p></p>
tags in WordPress post and page view
I have use WordPress filter but i can’t remove all extra <p></p>
tags.
This <p></p>
tags adding in last of page and post content.
But i want to remove all <p></p>
tags in WordPress post and page view
You must be logged in to post a comment.
Please use this line of code instead of
the_content();
/the_excerpt();
then it will works fine.for content
for excerpt
Hope so it will help. Thanks.
In PHP, wherever you have
echo get_the_content($params)
posted (maybe just content.php, depends on theme), do:That will replace any occurrences of
<p>
with the empty string''
; likewise for</p>
.Doing this will not matter whether you author the content in HTML or Visual modes, if it’s there, it’ll remove it; if not, it won’t break it.
If you just don’t like the style wherever you have
<p></p>
tags, then postp{}
from style.css, and describe how you want it to look – is it the gap between paragraphs you want smaller or bigger, for example?Please try with below code:
It will remove all extra
<p>
tags from content.Thanks!