How to display different menus for registered users and visitors in WordPress

How to display different menus for registered users and visitors in WordPress

When running a WordPress membership site, a WordPress forum, or allowing users to submit posts, you may run into situations where you want to display different navigation menus to logged in and out users. For example, you might want to show users who are logged in a link to your profile and a link to login or register for users who are not logged in. In this article, we will show you how to display different menus to logged in users. WordPress.

Creating multiple menus in WordPress

In WordPress, even if your theme has one menu location, you can still create multiple menus for the same location.

Option 1) Go to Appearance » Menus, create two menus with logged in and logged out. Create a menu named “logged-in” and create another named “logged-out”.

After creating the menus, add the following code to your theme’s functions.php file

function my_wp_nav_menu_args( $args = '' ) { if( is_user_logged_in() ) { $args['menu'] = 'logged-in';} else { $args['menu'] = 'logged-out';} return $args;}add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );

That’s it, logged in visitors will see the “logged-in” menu and unlogged or logged out users will see the “logged-out” menu

This method allows you to create two different menus for your users, so you can freely update your menus for online or offline users. There are other ways to do the same thing. For example, if you only want to add login and logout links to your navigation menu, you need to add custom menu items in the WordPress navigation menu.

Option 2) While there are different plugins to create a dynamic navigation menu, we recommend using the free User Menus plugin from Jungle Plugins.

The plugin provides three main sets of features that are useful for creating dynamic menus:

  • Visibility controls for menu items, for example, who can see each menu item (everyone, offline users, online users, specific user roles)
  • User information recorded in the navigation menu, for example, “Hello, John Doe.”
  • Log in and log out links for navigation menu

We hope this article helped you display different menus to registered users on your WordPress site. Remember that if you have your website hosted in Plhuit we can take care of doing this for you. If you are not yet a Phluit user, check out our plans.

Related Articles

What is Wordcamp? WordPress Tips

What is Wordcamp?

Not only has WordPress powered 43% of all internet websites, but it has also become a worldwide community of professionals who aim to make the most out of this popular platform. Users from all over the world contribute to workshops and events to share ideas, boost innovation and support one another.

Updated Jul 26, 2025
How to Setup a WordPress Newsletter with MailChimp WordPress Tips

How to Setup a WordPress Newsletter with MailChimp

MailChimp is one of the very best newsletter software on the planet. MailChimp enables you to create highly engaging newsletters with stunning visuals, launch various campaigns, track them effectively, split test, and measure ROI. It’s straightforward to use and has tons of customization features. I

Updated Jul 26, 2025
9 Best WordPress Podcasting Plugins to Grow Your Audience WordPress Tips

9 Best WordPress Podcasting Plugins to Grow Your Audience

Whoever is looking for the best WordPress podcasting plugins, the search ends now. After going through many different solutions and tools, we picked only the best ones. A collection you can benefit from is now ready and set for you and your business. With the popularity of podcast shows growing each

Updated Jul 27, 2025

We use cookies to enhance your experience, provide live chat support, and analyze site traffic. By clicking "Accept", you consent to our use of cookies.

Cookie Policy
Accept