I have installed the module subusers and appears a tab named "Subusers" in the profile. How can I remove this tab?

I tested this code in template.tpl.php and I didn't work:

function mytheme_preprocess_page(&$vars) {

$unwanted_tabs = array('user/%/subuser');
  foreach ($variables['tabs'] as $group_key => $tab_group) {
    if (is_array($tab_group)) {
      foreach ($tab_group as $key => $tab) {
        if (isset($tab['#link']['path']) && in_array($tab['#link']['path'], $unwanted_tabs)){

I tried with this code:

function mymodule_menu_alter(&$items) {


2 Answers 2


The tabtamer module provides an easy way to remove tabs, both those generated by core as well as those generated by modules.


Same issue I faced but I used patch for it which is still needs review but its work form me patch because Tabtamer hides tab from every user. So I downloaded the patch file in sites/all/modules/contrib/subuser

wget https://www.drupal.org/files/issues/subuser-remove-tab-if-no-permissions-148590-11.patch

and then applied patch with following command.

git apply -v subuser-remove-tab-if-no-permissions-148590-11.patch

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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