WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a custom post type which supports editor. (WordPress ver. 3.5)

I want to customize the editor for it.

  1. Make it readonly
  2. Hide "Add Media" button
  3. Hide HTML editor
  4. Remove status bar showing word count

I am using the following code:

add_filter( 'tiny_mce_before_init', function( $args ) {
     $args['readonly'] = 1;
     $args['media_buttons'] = 0;
     $args['theme_advanced_disable'] = "code";
     return $args;

Only readonly is working. Is it not possible to do other customization using tiny_mce_before_init?

share|improve this question
+1, it's an interesting question. But in Wordpress, the "Add media" button is not directly integrated into TinyMCE, but stays outside of it. I don't think you can disable it via the TinyMCE configuration. I'm just guessing, but disable adding media sounds to me like prohibiting access to the media library. So maybe this could be achieved by setting/removing the appropriate rights to/from the user role. – feeela Dec 27 '12 at 19:20
up vote 5 down vote accepted

It should be 'media_buttons' => FALSE.

array (
    'textarea_rows' => 5,
    'media_buttons' => FALSE,
    'teeny'         => TRUE,
    'tinymce'       => TRUE

… creates this editor:

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.