Empty paragraphs between <p></p> tags can be a real nuisance in your code (especially WordPress) as they add empty white space. There are a number of jQuery methods to remove empty para tags such as:-
<script type="text/javascript"> jQuery(document).ready( function($) { // remove the empty p tags $('.entry-content p').each(function() { var $this = $(this); if($this.html().replace(/\s| /g, '').length == 0) $this.remove(); }); }); </script>
But there’s a much simpler way to achieve this with CSS Only
Simply add the following CSS to your styles:-
p:empty { display: none; }
Bang the empty paragraphs are gone!