The Challenge of Static Menus

Most WordPress themes display the same navigation menu to every visitor, regardless of their relationship with your website. While this works for standard informational pages, it falls short for sites with user accounts. For example, a membership site might want to show a "Premium Dashboard" link only to logged-in subscribers, or a corporate site might want to display a "Staff Directory" link exclusively to users with an Editor or Administrator role.

The Menu Item Visibility Control plugin adds a powerful visibility logic field to your standard WordPress menu builder, allowing you to show or hide individual links based on custom rules.

Configuring Conditional Links

  1. Installation: Go to Plugins > Add New, search for "Menu Item Visibility Control", install, and activate the plugin.

  2. Opening the Menu Builder: Navigate to Appearance > Menus.

  3. Setting Up Visibility Rules: Click the arrow on any menu item to expand its advanced settings panel. You will find a new field labeled Visibility Condition.

  4. Writing Conditional Expressions: Enter standard WordPress conditional statements to control when the link should appear:

    • To show a link only to logged-in users, enter: is_user_logged_in()

    • To show a link exclusively to guests (logged-out users), enter: !is_user_logged_in()

    • To target a specific page, use: is_page('contact')

  5. Saving Your Navigation Layout: Click Save Menu to apply your visibility rules.

Real-World Testing Workflow

To verify your rules are working correctly, log out of your administrator account or open an Incognito window to view your site as a regular guest. The member-specific navigation links will be cleanly hidden from view.

This approach allows you to maintain a single, dynamic navigation menu that tailors itself to each user's access level, keeping your header clean and relevant for every visitor.