Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Function to remove wpautop filter for specific post IDs
/**
* Function to remove wpautop filter for specific post IDs
*/
add_action( 'init', 'do_ma_thang' );
function do_ma_thang() {
global $wp_query;
$exclusion = array( 1, 5, 7 ); // add post IDs here
if ( in_array( $wp_query->post->ID, $exclusion ) )
remove_filter( 'the_content', 'wpautop' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.