hide collapsible fieldsets on node edit I understand how to edit a specific content type with form_alter

my_module_form_node_form_alter(&amp;$form, $form_state) {

  $type = $form['#node']-&gt;type;

  if ($type == 'my_content_type') {

  } 
}


I would like to hide all collapsible fieldsets EXCEPT scheduling. How do I only target these other fieldsets to hide?

http://screencast.com/t/ozHu5esPGc
Dull ax approach would be to cycle through your $form looking for fieldsets and unsetting (now setting #access to FALSE) all but the one you want to keep, eg, something along the lines of...

// drupal_set_message('&lt;pre&gt;' . print_r($form, TRUE) . '&lt;/pre&gt;');
foreach($form as $key =&gt; $field) {
  if ($key != 'field_FIELDNAME' &amp;&amp; is_array($field)  &amp;&amp; $field['#type']=='fieldset' &amp;&amp; $field['#collapsible']) {
    // unset($form[$key]);          // ADDITION/EDIT: '#access' below is a better/working approach
    $form[$key]['#access'] = FALSE; // than unset if required fields are in the fieldset :)
  }
}


...with the drupal_set_message() helping to get the field_FIELDNAME for your scheduling fieldset.

Just realize that without further logic, you would never be able to edit any fields inside these fieldsets again.

Another option might be to check out the nodeformcols module that makes lengthy node forms a bit nicer and does contain this functionality out of the box for both fields as well as fieldsets.