Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
add_filter('the_content', 'remove_p_tags', 20, 1);
function remove_p_tags($content){
$content = force_balance_tags($content);
return preg_replace('#<p>\s*+(<br\s*/*>)?\s*</p>#i', '', $content);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment