X

Disable the visual editor for posts and pages

WP Mail SMTP Review - Enter SMTP info

Adding this snippet to the functions.php of your wordpress theme will disable the visual editor for both posts and pages.


add_filter('user_can_richedit' , create_function('' , 'return false;') , 50);

Comments  Leave a Reply

  1. Cliff Paulick May 2, 2012 at 10:34 pm

    How do you make the editor totally gone (e.g. display:none; ) for certain post types? For example, all content will be by filling out custom fields. Thanks, Kevin.

    1.  Hi Cliff, This is a sample custom post type


      function sample_post_type() {
          register_post_type( 'sample_cpt',
              array(
                  'labels' => array(
                      'name' => __( 'Sample' ),
                      'singular_name' => __( 'Sample' ),
                  ),
              'public' => true,
              'menu_position' => 5,
              'rewrite' => array('slug' => 'sample'),
              'supports' => array('title','thumbnail','editor'),    // supports options

              )
          );
      }
      add_action( 'init', 'sample_post_type' );

      The following can be added,

      ‘title’
      ‘editor’ (content)
      ‘author’
      ‘thumbnail’ (featured image, current theme must also support)
      ‘excerpt’
      ‘trackbacks’
      ‘custom-fields’
      ‘comments’ (also will see comment count balloon on edit screen)
      ‘revisions’ (will store revisions)
      ‘page-attributes’ (menu order, hierarchical must be true to show Parent option)
      ‘post-formats’ add post formats, 

      http://codex.wordpress.org/Function_Reference/register_post_type

      So if you remove the option editor from that array above it will not display the editor, then add excerpt or what ever other options you would like.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!