jQuery remove empty p tags

Glenn Glenn's Blog 2 Comments

In content management systems like WordPress we often find that the system auto-generates <p></p> tags. That’s a real annoyance as it adds empty space amongst layouts. Here’s a simple jQuery snippet we often use to remove this:- In our example we are targeting “.entry-content’, but this can be applied to any div. Let us know how you get on.