Disable WYSIWYG Editor For Custom Post Types

If you need to make sure that your custom post type doesn’t have the ‘visual’ tab, you can easily diable it. Suppose you have a custom post type named ‘movie’:

add_filter( 'user_can_richedit', 'disable_for_cpt' );
function disable_for_cpt( $default ) {
	global $post;
	if ( 'movie' == get_post_type( $post ) )
		return false;
	return $default;
}

3 thoughts on “Disable WYSIWYG Editor For Custom Post Types”

Leave a Reply to Ita Cancel reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: