Menu Item Visibility Control

Control individual menu items' visibility based on your desired condition.

Author:Hassan Derakhshandeh (profile at wordpress.org)
WordPress version required:5.4
WordPress version tested:5.8.2
Plugin version:0.5
Added to WordPress repository:03-08-2011
Last updated:03-11-2021
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:90
Rated by:69
Plugin URI:
Total downloads:166 755
Active installs:10 000+
plugin download
Click to start download

Using this plugin you can use WordPress Conditional Tags to enable or disable menu items on the front-end. It works like ‘Widget Logic’ but for menu items.

PLEASE NOTE The conditions are PHP codes that are evaluated using PHP’s “eval” function, meaning anyone who has access to the Menu manager in WordPress can execute any code. Be mindful of who has access to the Menu manager.

Usage

You must insert conditional tags in the “Visibility” box in the menu item options form. You can use any PHP or WordPress functions to build crazy conditions and logics for menu items. For example, to hide the menu item on homepage you can set the visibility to:

! is_home()

Show the menu only to logged-in users:

is_user_logged_in()

Show the menu only to guest visitors:

! is_user_logged_in()

To show the menu item based on user capability:

current_user_can( 'manage_options' )