How to remove unwanted tabs from pages in Drupal 4.7.x, 5.x, 6.x

Drupal core together with different modules subjoins tabs to pages that are not demanded for common users, or not required at all. It’s available to link to the page in another way, as some customers don’t appreciate that they can click on the tab over a node. Here is shown the approach for Drupal 4.7.x and Drupal 5: In releases of Drupal antecedent to 6, there was not a possibility to modify the hook_menu() engendered tabs from code, so the demonstrated on this page fluent will find and strip out a tab put on its title. In Drupal 6 release, there is now the hook_menu_alter() fluent involved, which enables to modify diverse characteristics of menu wisps that are installed by fundamental or other modules. Using Drupal 6 one should contemplate using hook_menu_alter in substitution, which is more accurate, and is easier/more operative. Exists a thing that hook_menu_alter isn’t able to do while this page’s technique can is delete the “View” tab (having any reasons to delete the View tab, utilize the described technique, and use hook_menu_alter for the remainings of tab removals). Step 1 of 2 Dispose the theme’s template.php file. If it doesn’t subsist, build up a blank one. This is the place for locating the customization PHP code. Step 2 of 2 General functions allocated in the basis template.php file should commence with the theme title. Inside the code fragment below interchange “yourthemename” with the authentic title of the theme, for instant “garland”. May be a ‘_phptemplate_variables’ function is already existent and identified depending on what theme is being used, if so the function doesn’t need to be included from the fragment below again. The tab deletion procedure is done in the yourthemename_removetab() fluent, go over to a plain text tab superscription, along with the PHPTemplate off-and-ons, and the fluent will delete the tab. In the previous instant segment the ‘address book’ tab supplemented to the eCommerce package was extracted from the user’s profile page. Notes Challenge yourthemename_removetab(‘tab name’, $vars); for all the tabs required to be disposed. No other packages ought to be arranged to use this. If more distinct control of any page on the site to act upon is needed (since various tabs might apportion the same title), the remove-tab fluent can be wrapped with stipulations that examine the URL path submissions. The approach for Drupal 6 is illustrated below: In the preamble it is referred that substantially using Drupal 6’shook_menu_alter is considered to extract tabs in substitution. Nevertheless if using this page’s tab deletion technology is demanded, the below demonstrated code is applicable for use in Drupal 6. The annotations and information in the foregoing steps still employ in the same way. Firstly either tack the initial code fragment as viewed, or else combine it with your currentpreprocess_page() fluent in template.php (the same two function can’t be applied, so search for preprocess_page). In two code fragments, all examples of “yourthemename” should be changed to the title of the present theme, the disclosure and shutdown of PHP tags don’t need to be involved. Then add this function “outside” of the yourthemename_preprocess_page() function: After retention template.php, the theme registry demands to be reorganized before the correctives will take effect. This can be provided by purification of the cache at Administer > Site configuration > Performance, or with the help of helper modules which are likely to be called the Admin Menu (top left icon) or Devel (in the Devel block).