Main content begins here

Remove/Delete TinyMCE WYSIWYG Editor From Specific CCK Field in Drupal Node Edit Form

Wednesday, November 14, 2012

Infrequently I need to remove the TinyMCE WYSIWYG Editor from a particular CCK field in a node edit form. There can be complications with this because of various other modules, etc. Using this thread I pieced together a solution that works for me for D6. Maybe it'll help you. Create your own module, then add the following code. Tailor it for your particular content type and field.

function MODULENAME_form_alter(&$form, $form_state, $form_id) {
  // target content type is called 'resource' - replace that below with your content type
  if ($form_id == 'resource_node_form') {
    $form['#after_build'][] = 'resource_node_form_after_build';

function resource_node_form_after_build($form, &$form_state) {
  // target field name is 'slideshare1' - replace that below with your field
  $form['field_slideshare1'][0]['format']['#access'] = FALSE;
  return $form;

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <h2> <br> <img>
  • Lines and paragraphs break automatically.

More information about formatting options

This question is for testing whether you are a human visitor and to prevent automated spam submissions.

John was incredibly professional, very responsive and timely with his emails. He knows his code, implemented changes easily, cheerfully did updates after "oops, we need..." John was firm, courteous, and his code worked wonders. We enjoyed our project, and definitely look forward to working with him again.

Adrean C.
Copyright ©2001-2018 Way Cool Web Design LLC. All Rights Reserved.