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:

To display a custom post in WordPress, you can follow these steps:First, you need to create a custom post type. This can be done by adding some code to your theme's functions.php file or by using a custom post type plugin.
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...
Jetpack is a popular WordPress plugin developed by Automattic, the same company behind WordPress.com. It offers various features and tools to enhance the functionality and performance of a WordPress website. However, there might be instances where you want to ...