عبدالرحمن أبوالسعد

مصمم ومطور مواقع إنترنت

المدونة

Remove empty paragraphs added by WordPress

Remove empty paragraphs added by WordPress

 

WordPress automatically adds paragraphs and line breaks to your content.

This is awesome when you’re trying to write a quick blog post… and infuriating when you’re trying to use specific, well-formed markup on a page. I’ve spent far too much time trying to prevent WordPress from adding empty <p> tags throughout my markup.

 

Fortunately, there’s an easy fix!

Just drop this snippet into your functions.php file:

 

Or try this one:

 

Thanks