Type to search.

#606 by installs

Nav Menu Roles

by HelgaTheVikingVersion 3.0.0

Hide custom menu items based on user roles.

Active installs
70,000+
#606 of 1,000
Downloads, all time
1.8M
1,843,674
Downloads, 30 days
29.5K
25.4K in the last 7
Rating
4.9 / 5
219 reviews
Last updated
1 day ago
Oct 30, 2026
Version
3.0.0
35 releases

Upkeep and compatibility

Last updatedOctober 30, 2026Updated in the last 3 months
Tested up toWordPress 7.1.0Covers WordPress 7.1.4, the current release
Needs WordPress6.6.0 or newer
Needs PHP7.4 or newer
First publishedSeptember 20, 2012
Support, last two months1 of 1 threads resolved (100%)

Reviews

4.9 / 5 from 219 reviews

Reviews by star rating
5 stars213
4 stars2
3 stars1
2 stars0
1 star3

Downloads, last 30 days

Low 95 a dayHigh 16.1K a day

What the author says it does

This plugin lets you hide custom menu items based on user roles. So if you have a link in the menu that you only want to show to logged in users, certain types of users, or even only to logged out users, this plugin is for you.

Nav Menu Roles is very flexible. In addition to standard user roles, you can customize the functionality by adding your own check boxes with custom labels using the nav_menu_roles filter and then using the nav_menu_roles_item_visibility filter to check against whatever criteria you need. You can check against any user meta values (like capabilities) and any custom attributes added by other plugins.

IMPORTANT NOTE

In WordPress menu items and pages are completely separate entities. Nav Menu Roles does not restrict access to content. Nav Menu Roles is only for showing/hiding nav menu items. If you wish to restrict content then you need to also be using a membership plugin.

Usage

  • Go to Appearance > Menus
  • Set the “Target audience” to either “Everyone”, “Logged In Users”, or “Logged Out Users”. “Everyone” is the default.

The opening of the plugin's own description. The full text, installation notes and changelog are on its WordPress.org page.

Questions the author answers

I don’t see Appearance > Menus. Where are the settings?

Block themes, such as Twenty Twenty-Five, use the Navigation block instead of classic menus, so WordPress hides Appearance > Menus.

Since version 3.0.0, the Nav Menu Roles settings are in the Site Editor instead:

  • Go to Appearance > Editor > Navigation and edit your menu.
  • Select a link or submenu.
  • In the block settings sidebar, open the “Nav Menu Roles” panel.
I don’t see the Nav Menu Roles options in Appearance > Menus?

Nav Menu Roles adds its options through the wp_nav_menu_item_custom_fields hook, which has been part of WordPress since 5.4. If a theme or plugin replaces the menu editor’s Walker and leaves that hook out, no plugin can add fields there.

I’m using XYZ Membership plugin and I don’t see its “levels”?

There are apparently a few membership plugins out there that don’t use traditional WordPress roles/capabilities. My plugin will list any role registered in the traditional WordPress way. If your membership plugin is using some other system, then Nav Menu Roles won’t work with it out of the box.

Existing Compatibility Plugins
  • Wishlists Memberships
  • WooCommerce Memberships

If your membership plugin is not listed here, you may be able to use the above bridge plugins as a template. Scroll down to the bottom of the main plugin file and you will see a section for “Helper Functions”. If you modify the 3 wrapper functions according to your membership plugin’s logic, the rest of the plugin should handle the integration with Nav Menu Roles.

Adding a new “role”

The roles in NMR are filterable distinct from the global $wp_roles. This allows for compatibility to be added between plugins that don’t use the core roles to determine access, like some membership plugins.

/** * Add custom roles to Nav Menu Roles menu list * param: $roles an array of all available roles, by default is global $wp_roles * return: array */ function kia_new_roles( $roles ) { $roles['new-role-key'] =…

Sort the roles alphabetically

Add the following snippet to your theme’s functions.php file:

/* * Sort the NMR roles * @param: $roles an array of all available roles with ID=>Name * @return: array */ function kia_sort_roles( $roles ) { if ( is_admin() ) { $array_lowercase = array_map( 'strtolower', $roles ); array_multisort( $array_lowercase, SORT_ASC, SORT_STRING, $roles ); return $roles; } } add_filter( 'nav_menu_roles', 'kia_sort_roles' );

Latest changelog entry

3.0.0

  • Requires: PHP 7.4 and WordPress 6.6
  • New: Add support for block themes and the Navigation block.
  • New: Add wpml-config.xml

Screenshots

From WordPress.org.

Tagged

Plugins that share its tags

#543 by installs

User Menus – Nav Menu Visibility

by Daniel Iser

Show/hide menu items to logged in users, logged out users or specific user roles. Display logged in user details in menu. Add a logout link to menu.

Installs
80,000+
Rating
5.0 (1.3K)
Updated
48 days ago

#407 by installs

Menu Image, Icons made easy

by Rui Guerreiro

Adds an image or icon in the menu items. You can choose the position of the image (after, before, above, below) or even hide the menu item title.

Installs
100,000+
Rating
4.5 (123)
Updated
15 months ago

#157 by installs

Admin Menu Editor

by Janis Elsts

Lets you edit the WordPress admin menu. You can re-order, hide or rename menus, add custom menus and more.

Installs
300,000+
Rating
4.6 (312)
Updated
2 months ago

#166 by installs

Max Mega Menu

by megamenu

An easy to use mega menu plugin. Written the WordPress way.

Installs
300,000+
Rating
4.8 (882)
Updated
47 days ago

#451 by installs

Duplicate Menu

by Jon Christopher

Easily duplicate your WordPress menus with one click.

Installs
100,000+
Rating
4.6 (104)
Updated
10 months ago

#559 by installs

Menu Cart for WooCommerce

by WP Overnight

Automatically displays a shopping cart in your menu bar. Works with WooCommerce and Easy Digital Downloads (EDD)

Installs
70,000+
Rating
4.6 (99)
Updated
12 days ago

Where this page's numbers come from

Read from the WordPress.org plugin API on , when WordPress 7.1.4 was the current release. WordPress.org rounds active installs into buckets. These are the directory's figures, not my verdict, and I haven't tested this plugin. The author takes donations at their donate page.