Loop through posts? Want to remove extra newlines in actual post HTML/content on backend

I have a ton of posts that we created, but unfortunately there are a lot of blank spaces. This is an example of what I see on the backend, in the actual post:

<h1>This is a post title</h1>

&nbsp;

&nbsp;

Words here. More words.

&nbsp;

&nbsp;

Words down here.

So, when that is rendered on the page on the Front end, there are extra line breaks that I’d like to get rid of.

Is there a way to loop through the actual posts on the backend? Then I can (somehow) check for 2+ empty lines and/or  , and remove them.

Or – a solution to the symptom, not the problem – would I be better off somehow using CSS to remove such lines?

Read more here:: Loop through posts? Want to remove extra newlines in actual post HTML/content on backend

Leave a Reply

Your email address will not be published. Required fields are marked *