Disable WYSIWYG Editor for WordPress Custom Post Types

a few seconds read

There may arise a need when developers want to hide the Visual editor aka WYSIWYG Editor from their Post types.

If such is the case, you should just implement the following code in the functions.php file of your theme OR in the plugin files if you have a plugin installed to set up CPTs:

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;
}
Facebook Twitter LinkedIn Telegram Whatsapp Pocket

Related Posts:

There are times when you need to disable comments on your WordPress site. There are two cases contextual to disabling WordPress comments: Disabling comments for individual posts and pages Disabling comments completely Disabling comments for individual WordPr...
The default WordPress search is the only thing that used to annoy me a lot and I wasn’t using it on any of my WordPress sites. There are a number of reasons back then to stop using WordPress search feature, and the best one for me was it throwing unrelated lin...
WordPress automatically adds paragraph tags (<p>) in the posts wherever it notices double line-breaks. For example, if you write one line and press the return key twice, it considers you want to add a paragraph there, and then suitable tags will be added...