Since I'm using webform, I don't require users to have access to personal contact forms.

How do I disable it and keep it from showing up under the user account settings in D7?

Thanks

Comments

bhosmer’s picture

Visit: /admin/config/people/accounts and uncheck the box "Enable personal contact form..."

Also, /admin/people/permissions and uncheck the box "Use personal contact form..."

rolandk’s picture

Thanks very much. That worked.

 /admin/people/permissions and uncheck the box "Use personal contact form..."
bhosmer’s picture

Awesome. Glad I could help.

T-lo’s picture

Needed this too!

also styled out the option on the edit profile page, and it's all gone!

Tom C Lopez

dooglet’s picture

Whilst styling the option away is one way of removing it from the user profile page a much cleaner way of achieving the same result is to add the following code to your themes template.php:

function yourtheme_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'user_profile_form') {
    unset($form['contact']);
  }
}

This simply unsets the contact section of the form before it gets rendered.

Hope this helps!

jsimonis’s picture

I used that, but even after a cache clear it still shows.

HorsePunchKid’s picture

It's only a guess, but if you are using an administration theme or the overlay module (which uses a different theme), I think this suggestion will not work. One option might be to use a custom module instead, with approximately the same code, and be sure that that module has a weight (in the {system} table) than the contact module.

yenidem’s picture

this is worked for me. this is ultimate solution. thank you.

ressa’s picture

Thanks dooglet. Setting the permissions doesn't seem to remove the form form the users' contact edit form, your snippet fixed it.

joshuautley’s picture

Brilliant. Not many people explain that this method is a performance saver since it is done on the server side and not by the clients browser.

That's what the "Drupal Way" is... its about performance and such not because we're a cult or something. ( ;

Josh Utley, President & CEO
Intrepid Network Inc. | Multimedia Services & Business Solutions

"Our mission is to provide a more personable multimedia service along with the highest quality business solutions."

postscripter’s picture

Thanks, this worked.

JohnnyW’s picture

Yes, I am not a novice when it comes to Drupal management, and D7.50 isn't respecting the "uncheck" box for "Use users' personal contact forms" permissions.

So yeah, your suggestion was a perfect remedy :)

Thanks!

Abelito’s picture

The solution I used was to just hide the form and form settings using CSS.
Main Theme:

body.page-user- #contact-personal-form {
    display: none;
}

Admin Theme

body.page-user- #edit-contact {
	display: none;
}
chri5tia’s picture

"Enable personal contact form by default" just makes it so that users don't have this option checked by default. It still allows them to see and select this. Also, in permissions, "Use users' personal contact forms" is not selected for any role. Is there something else also? What about the permission, "Use the site-wide contact form". Does this also have to be unchecked for everyone?

aliceduck’s picture

I am also working on using webform instead of the personal contact form. Could you advise on how to do it?

stefan93’s picture

only the module works for me.
thx for the info

chri5tia’s picture

Just to update those who were not able to solve this problem with permissions alone, I used the simplify module to remove this section of the edit user form. It solved other problems for me as well.

https://www.drupal.org/project/simplify

BassPlaya’s picture

I am using Page Manager to manage the fields on the user edit forms (user_edit). The field for the Contact form seems to be part of "General Form" when you add form fields with page manager and you have to add the General form because that's the one that gives you the 'save' button.

Under admin/people/permissions I have disabled all possible permissions for:
Administer contact forms and contact form settings
Use the site-wide contact form
Use users' personal contact forms

Under admin/config/people/accounts I have unticked the box

CONTACT SETTINGS

  Enable the personal contact form by default for new users. 

Changing this setting will not affect existing users.

I have cleared the caches several times.
Still the contact forms show up.
Why?
Anyone?

Authentically,
BassPlaya