remove empty paragraphs from the_content?

WordPress will automatically insert <p> and </p> tags which separate content breaks within a post or page. If, for some reason, you want or need to remove these, you can use either of the following code snippets.

To completely disable the wpautop filter, you can use:

remove_filter('the_content', 'wpautop');

If you still want this to function try adding a later priority value to your filter something like:

add_filter('the_content', 'removeEmptyParagraphs',99999);

Leave a Comment