If you want to hide authoring information and the other fieldsets on new/edit node pages, add something like this to a module. It seems to work, but please reply if anyone's got a better solution.

You'll need to change 'news_article_node_form' to e.g. 'page_node_form' or whatever your node type is. Alternatively if you want it for all node types.

<?php
// Implementation of hook_form_alter
function news_article_form_alter($form_id, &$form) {

  if ($form_id == 'news_article_node_form') {

    // We're going to hide various fields by setting default values for them

    $form['author']['#type'] = 'value';
    $form['author']['name'] = array('#type'=>'value', '#value'=>$form['author']['name']['#default_value']);
    $form['author']['date'] = array('#type'=>'value', '#value'=>$form['author']['date']['#default_value']);


    $form['options']['#type'] = 'value';
    $form['options']['status'] = array('#type'=>'value', '#value'=>$form['options']['status']['#default_value']);
    $form['options']['moderate'] = array('#type'=>'value', '#value'=>$form['options']['moderate']['#default_value']);
    $form['options']['promote'] = array('#type'=>'value', '#value'=>$form['options']['promote']['#default_value']);
    $form['options']['sticky'] = array('#type'=>'value', '#value'=>$form['options']['sticky']['#default_value']);
    $form['options']['revisions'] = array('#type'=>'value', '#value'=>$form['options']['revisions']['#default_value']);

    $form['user_comments']['#type'] = 'value';
    $form['user_comments']['comment'] = array('#type'=>'value', '#value'=>$form['user_comments']['comment']['#default_value']);


    $form['menu']['#type'] = 'value';
  }
}
?>

Comments

StuartDH’s picture

I just tried this on a flexinode but I couldn't get it to work.

I pasted this on line 617 of the flexinode.module:

// Implementation of hook_form_alter
function flexinode_form_alter($form_id, &$form) {
if ($form_id == 'flexinode_form') {
// We're going to hide various fields by setting default values for them
$form['author']['#type'] = 'value';
$form['author']['name'] = array('#type'=>'value', '#value'=>$form['author']['name']['#default_value']);
$form['author']['date'] = array('#type'=>'value', '#value'=>$form['author']['date']['#default_value']);
$form['options']['#type'] = 'value';
$form['options']['status'] = array('#type'=>'value', '#value'=>$form['options']['status']['#default_value']);
$form['options']['moderate'] = array('#type'=>'value', '#value'=>$form['options']['moderate']['#default_value']);
$form['options']['promote'] = array('#type'=>'value', '#value'=>$form['options']['promote']['#default_value']);
$form['options']['sticky'] = array('#type'=>'value', '#value'=>$form['options']['sticky']['#default_value']);
$form['options']['revisions'] = array('#type'=>'value', '#value'=>$form['options']['revisions']['#default_value']);
$form['user_comments']['#type'] = 'value';
$form['user_comments']['comment'] = array('#type'=>'value', '#value'=>$form['user_comments']['comment']['#default_value']);
$form['menu']['#type'] = 'value';
}
}

Just below the * Implementation of hook_form(). info

Is this the best place to put and do we need to set the values to true/false

bradleyg’s picture

to

if ($form_id == 'flexinode_node_form') {

and that'll work.

bradleyg’s picture

It seems someone should put an option somewhere to disable these fieldsets. You find a better way yet?

bilgehan’s picture

You can administer this for anonymous and authenticated users in access control page. Normally only the user number 1 see all the fieldsets.

makkus’s picture

As this does not seem to work with Drupal 5:

Does anybody know how to hide (particularly) the Authoring information field?

Cheers,
Makkus

rushi-1’s picture

For Drupal 5:
I just commented out the following chunk of code in modules/node/node.module and the authoring field didn't show up

  // Node author information for administrators
  $form['author'] = array(
    '#type' => 'fieldset',
    '#access' => user_access('administer nodes'),
    '#title' => t('Authoring information'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#weight' => 20,
  );
  $form['author']['name'] = array('#type' => 'textfield', '#title' => t('Authored by'), '#maxlength' => 60, '#autocomplete_path' => 'user/autocomplete', '#default_value' => $node->name ? $node->name : '', '#weight' => -1, '#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous', t('Anonymous')))));
  $form['author']['date'] = array('#type' => 'textfield', '#title' => t('Authored on'), '#maxlength' => 25, '#description' => t('Format: %time. Leave blank to use the time of form submission.', array('%time' => $node->date)));

  if (isset($node->nid)) {
    $form['author']['date']['#default_value'] = $node->date;
  }

It should be in function node_form($node, $form_values = NULL)

If there is another direct way, I'm unaware of it.

underwearninja’s picture

The more elegant solution was posted here:
http://drupal.org/node/109917

depace’s picture

remove fieldsets from node add/edit forms

hook_form_alter($form_id, &$form)
{
	switch ($form_id) {
			case 'modulename_node_form':
				unset($form['author']);//remove authoring 
				unset($form['menu']);//remove menu options
				unset($form['options']);//remove publishing options
				unset($form['comment_settings']);//remove comment settings
				unset($form['path']);//remove url path settings (if path module is enabled)
				unset($form['log']);//log box
				unset($form['body_filter']['filter']);//remove input format
		}
}
momper’s picture

@ depace: where did you put this?

and if you disable "administer nodes" it is not possible to delete nodes anymore - right?
but how to hide all this stuff (wonderful would be per contenttype) with the possibility to delete nodes (minimum own nodes)?

thanks and greetings
momper

druvision’s picture

The following function worked for me. Put it in template.php


/**
* Change the node form
*/
function phptemplate_node_form($form) {
  // echo "<div style='direction:ltr;'>"; dprint_r ($form); echo '</div>';
  
  // Hide 'Log message' text area
  $form['log']['#access'] = FALSE;
  
  // Hide the author collapsable box
  $form['author']['#access'] = FALSE;
  
  // Hide the publishing options collapsable box
  $form['options']['#access'] = FALSE;
  
  // Open the file attachments collapsible block in a full state
  $form['attachments']['#collapsed'] = FALSE;
  
  return drupal_render($form);
}

Amnon
-
Professional: Drupal Israel | Drupal Development & Consulting
Personal: Hitech Dolphin: Regain Simple Joy :)

leisurman’s picture

How can you rename the labels like Authoring information and the labels inside of it like Authored by

CrookedNumber’s picture

Commenter bilgehan (above) is right. It's a simple permission issue.

User1 will always see all fieldsets on add/edit node pages. But if you'd like to hide that extra stuff (Authoring Information, Publishing Options, etc.) from other users, go to /admin/user/access and de-select the "administer nodes" permission (found under 'node module') for anyone who doesn't need to see/act upon these extra fieldsets.

sunitha-1’s picture

no need go for coding just do this
Go to Admin > Site Building > Themes > Configure. You'll see checkboxes that allow you to disable authoring information.

ras69’s picture

Thanks its work.

teldath’s picture

it works on drupal 6 with abarre theme, thank you very much

missmobtown’s picture

This worked for me. Thank you!

senseBOP’s picture

For those interested, I've create a module for my own personal use, which lets you set each individual option under the Authoring information and Publishing options sections of the node edit page.

At the moment, the module only sets these permissions globally and they apply to all content types.
Once I get approved for a CVS account, I'll contribute my module, and see about adding more features to it, such as choosing which content types the settings apply to, or maybe even a 'per content type permissions' functionality.

Anyways, just wanted to let you guys know that something IS coming, so stay tuned.

P.S. The module was written for Drupal 5.x

Marko B’s picture

Is module comming out soon? :-) can i get some beta relase, if you say it's working ok i would like to use it/test it :-)

send to marko@deepsun.net

thanx

momper’s picture

maybe this is interesting in general to:

http://drupal.org/project/formfilter

adammoro’s picture

I landed here trying find out how to remove the "post information" from a Webforms form. Doesn't seem like that's what this thread is about actually but just in case someone else lands here with the same question I had, all you have to do is goto Themes->Configure->Global Settings and uncheck the box for Webform under "Display post information on."

bsantos9’s picture

Thank you!! I just happen to have the same issue and this way I was able to solve it within seconds.

generalelektrix’s picture

Exactly what I was looking for, thanks!

pitxels’s picture

This module: formdefaults did the trick for me about hiding the authoring and other fields in the drupal forms :)

--
Drupal Theming at
www.pitxels.com

madipally’s picture

This is working for me (drupal 6)

function hook_form_alter($form)
{
$form['author']['#access'] = FALSE; // for disabling the author info
$form['options']['#access'] = FALSE; // for disabling the publishing option settings
$form['menu']['#access'] = FALSE;// for disabling the menu settings
$form['comment_settings']['#access'] = FALSE;// for disabling the comment settings
$form['path']['#access'] = FALSE;// for disabling the URL path settings
}

Thanks&Regards
Madipally Naveeen Kumar

Marko B’s picture

formfilter module is all you ever need for this, its perfect.

czeky’s picture

hi, any chance to disable just a parts of the "options"? I mean "Promoted on front page"

$form['options']['promote']['#access'] = FALSE; // for disabling the publishing option settings

does not work

momper’s picture

same question like czeky

sivaramapandianbtech’s picture

Try this .Its working for me.

$form['options']['#type'] = 'value';
$form['options']['status'] = array('#type'=>'value', '#value'=>$form['options']['status']['#default_value']);
$form['options']['moderate'] = array('#type'=>'value', '#value'=>$form['options']['moderate']['#default_value']);
$form['options']['promote'] = array('#type'=>'value', '#value'=>$form['options']['promote']['#default_value']);
$form['options']['sticky'] = array('#type'=>'value', '#value'=>$form['options']['sticky']['#default_value']);

Anonymous’s picture

+1 for formfilter module - perfect for hiding both individual fields and groups of fields from the new/edit node form etc

@czeky, momper: if you had read the rest of this thread (or even the comment just before yours), and tried people's suggestions you would have realised that the formfilter module does what you need...

EDIT: just found another module, which is even better for me: Node form columns. This also allows you to specify which form objects are expanded or collapsed, but unlike the formfilter module, it only works on the new/edit node form.

izdelava_internetnih_strani’s picture

If i do not want to show authoring info, i simply manipulate them via CSS, so they are still present but not shown.

samsul wibowo’s picture

its simple for drupal 7 (for webform)
just go admin>structure>types>manage>webform
click Display Setting and uncheck the box Display author and date information
then save

Jaypan’s picture

This thread has never been about webform, it's been about content types.

samsul wibowo’s picture

for content type (article or basic page)
admin>structure>types>manage>article (page)
on display setting unchecked Display author and date information

Jaypan’s picture

This thread is about removing these fieldsets from the node creation page, not the node display page.

mafzalzadeh’s picture

There is a module for drupal 8 that hides the author form depend on user roles.
Disable author