But how do I go about removing the p tags, without losing the font size, strong, etc.? … WordPress sure does seem to have an obsession with paragraphs.
Your question is, perhaps, a textbook example of the XY problem. Which may explain why none of the volunteers here has ventured to answer it.
By definition, only a paragraph block has the <p>
tag. Indeed, it’s the <p>
tag that makes it a paragraph. So, if you were to remove the <p>
tag from the paragraph block’s output, then it ceases to be a paragraph.
So removing <p>
tags doesn’t sound like the smart thing to do, and this is surely not what you need to do.
Luckily, you added:
It’s creating too much white space around it, namely above and below the text. … I’m looking for solutions to remove the excessive white space above and below the text.
It seems what you really want is to get rid of the space above and below the text. But the way to do that is NOT to remove the <p>
tag.
Rather, it’s some CSS from your theme that’s causing this: possibly some excess margin, padding or line-height. And the way to fix it is to add some custom CSS to override the theme’s CSS, and not to remove <p>
tags.
But to be able to give you such CSS code, we need to go under the hood and examine the HTML source of the specific page in question. This is why Muhammad asked you to share your site address, which you did not do.
To summarize:
1) If you’re convinced the way to solve your problem is to remove <p>
tags, then, just keep waiting. Someone else may chip in to help you, however long it might take.
2) But if you simply want to get rid of the white pace, then kindly provide the address of the page in question, so we can take a look and give you custom CSS code to fix the problem. There’s no way around this, unfortunately.
Standing by to help.