Skip to content

Instantly share code, notes, and snippets.

@rupert-ong
Last active December 17, 2015 18:59
Show Gist options
  • Select an option

  • Save rupert-ong/5657341 to your computer and use it in GitHub Desktop.

Select an option

Save rupert-ong/5657341 to your computer and use it in GitHub Desktop.
Wordpress: Remove Unwanted BR and P Tags around Shortcodes
// Place in functions.php
remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 12);
// Place in your shortcode (in functions.php)
$content = wpautop(trim($content))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment