May 5, 2013

Disable WYSIWYG Editor for WordPress Custom Post Types

There are times when developers want to hide the Visual or the WYSIWYG Editor from their Custom Post Types. If such is the case, add the following code in your functions.php to disable WYSIWYG editor in your Custom Post types and save the changes:

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

Thanks to Kaily Lampert

Rahul C.

Rahul C. is a web developer running W3Bits since 2012. He loves making things on the internet and sharing his extensive knowledge about front-end web development.

Want to stay up to date?

Sign up for our email newsletter.

Only the relevant, to-the-point content. Zero spam.