Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Drupal 11.4.6 Update released for Drupal core (11.4.6)! Release: Drupal 10.6.16 Update released for Drupal core (10.6.16)! Release: Cms 2.1.4 Update released for Drupal core (2.1.4)! Release: Drupal 12.0.0-alpha1 First alpha version released for Drupal core (12.0.0-alpha1). Release: PhotoSwipe - Responsive JavaScript Modal Image Gallery 5.0.9 Minor update available for module photoswipe (5.0.9). Release: AI (Artificial Intelligence) 1.4.8 Minor update available for module ai (1.4.8). Release: AI (Artificial Intelligence) 1.3.13 Minor update available for module ai (1.3.13). Release: OpenCulturas 3.0.7 Minor update available for distribution openculturas (3.0.7). Module Revived: Image field to media 3.0.2 Module image_field_to_media updated after 13 months of inactivity (3.0.2). Security Coverage: Analyze PostHog Module analyze_posthog now has official Drupal security advisory coverage.

menu_hide_parent

1 sites No security coverage
View on drupal.org

This module automatically hides parent menu items that lead to no accessible child links for the current user. This keeps navigation menus clean by preventing placeholder items like "Create" or "Settings" from appearing if the user lacks permissions for any sub-items.

Menu Hide Parent automatically hides placeholder parent menu items (such as those using or routes) when they have no visible child links after access checks.

This ensures that top-level items like Create, Manager, or Settings do not appear in navigation menus when users don’t have permission to access any of their sub-items — keeping menus clean, contextual, and role-aware.

Features

  • Automatically hides parent menu items using or targets when they have no accessible children.
  • Respects role-based and permission-based access controls.
  • Cache-safe, runs only on menu tree rebuilds, not every page load.
  • Per-menu enable/disable configuration via the admin UI.

Configuration

  • Go to Configuration → User Interface → Menu Hide Parent (/admin/config/user-interface/menu-hide-parent).
  • Check the menus where you want to hide empty placeholder parent items.
  • Save configuration.
  • (Optional) Grant the Administer Menu Hide Parent settings permission to trusted site builders.

Use Cases

  • Hiding “Create” or “Manager” menu headers when users can’t create or manage any content types.
  • Preventing empty parent items from cluttering navigation for restricted roles.

Technical Notes

  • Implements hook_menu_tree_alter() to prune menu trees at render build time.
  • Adds user.roles as a cache context for per-role variants.
  • Fully compatible with cached menu rendering and configuration-managed menus.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Apr 2026
Latest release
3 months ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.1.0-alpha3 Pre-release 10–11 May 20, 2026
1.1.0-alpha2 Pre-release 10–11 Apr 20, 2026
1.1.0-alpha1 Pre-release 10–11 Apr 20, 2026