[agentsw ua=’pc’]
Do you want to show different menus to logged-in users in WordPress?
By default, WordPress allows you to show the same navigation menu in a specific location in your theme. But what if you wanted to show a different menu to logged-in users on your website?
In this article, we’ll show you how to easily show different menus to logged-in users in WordPress.
Why Show Different Menus to Logged in Users in WordPress?
Changing different areas of your WordPress website based on your visitors and their activity makes your site feel personalized for each user.
This personalized content helps you improve the user experience on your WordPress website.
Now, if you run a website where users don’t need to register or log in, then you can probably use the same navigation menus across your website.
However, other websites may greatly benefit from showing custom menus to logged-in users.
For instance, websites like an online store, a WordPress membership site community, or an online learning platform, can all benefit from personalized navigation menus.
A personalized navigation menu for logged-in users helps them more easily find things they signed up for.
For instance, a user on an online store can manage their account, or a member of a paid community can easily renew their subscription or view the online courses they purchased.
By default, WordPress does let you create as many navigation menus as you want. However, you can only choose to show one menu at a particular location in your WordPress theme.
That being said, let’s take a look at how to easily change this behavior and show different menus to logged-in users in WordPress.
- Show Different Menus to Logged in Users in WordPress Using a Plugin
- Manually Select Logged in Menu in WordPress Using Code
Creating Menus for Logged in and Non Logged in Users in WordPress
No matter which method you use, you’ll first need to create both of the navigation menus that you want to show to your logged-in and logged-out users.
Simply head over to the Appearance » Menus page in the WordPress dashboard. If you already have a navigation menu that you use on your website for all users, then this can be your default menu.
After that, click on the ‘create a new menu’ link to create a new custom menu for your logged-in users.
Here you can add menu items that you want to show to registered or logged-in users. For example, you might want to add a logout link to your menu.
On the left-hand side of the screen, you can see a list of your website pages. Simply check the box next to any page you want to add to your menu and click the ‘Add to Menu’ button.
You can also drag and drop the menu items on the right side of the screen to rearrange them.
Further down the page, you can choose a location to display your menu. But, you don’t need to assign a location to this menu now. We’ll do that later in the article.
Don’t forget to click on the ‘Save Menu’ button to store your changes.
For more details on creating menus, take a look at our beginner’s guide to WordPress navigation menus.
Method 1. Show Different Menus to Logged in Users in WordPress Using a Plugin
This method is easier and recommended for all WordPress users.
First, you need to install and activate the Conditional Menus plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, you need to visit the Appearance » Menus page and switch to the ‘Manage Locations’ tab.
From here, you’ll see the list of available menu locations defined in your WordPress theme and the menus that are currently displaying.
For instance, it is showing that our Primary Menu location is showing a navigation menu titled ‘Main Menu’.
Now, we need to tell the plugin to show a different menu when a certain condition is matched.
To do that, click on the ‘+ Conditional Menu’ link, and then select the navigation menu you want to show to the logged-in users from the drop-down menu.
Next, you need to click on the ‘+ Conditions’ link.
This will bring up a popup where you’ll see a bunch of conditions to choose from.
Simply check the box next to the ‘User logged in’ option, and then click on the Save button.
You can now visit your website to see the logged-in user menu in action. You can also log out of your WordPress admin to view the navigation menu that’ll be shown to all other users.
Method 2. Manually Select Logged in Menu in WordPress Using Code
This method requires you to add code to your WordPress website. If you haven’t done this before, then take a look at our guide on how to copy and paste code snippets in WordPress.
First, you need to add the following code to your theme’s functions.php file or a site-specific plugin.
function my_wp_nav_menu_args( $args = '' ) {
if( is_user_logged_in() ) {
// Logged in menu to display
$args['menu'] = 43;
} else {
// Non-logged-in menu to display
$args['menu'] = 35;
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );
Make sure that you replace 43 and 35 with the IDs for navigation menus you created earlier.
You can find the ID of a navigation menu by selecting it on the Menus page. You will see the menu ID number in your browser’s address bar.
We hope this article helped you learn how to easily show different navigation menus to logged-in users in WordPress.
You may also want to see our guide on how to get a free email domain, or see our expert roundup of the best business phone services for small business.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
[/agentsw] [agentsw ua=’mb’]How to Show Different Menus to Logged in Users in WordPress is the main topic that we should talk about today. We promise to guide your for: How to Show Different Menus to Logged in Users in WordPress step-by-step in this article.
Why Show Different Menus to Logged in Users in WordPress?
Changing different areas of your WordPress website based on your visitors and their activity makes your site feel aersonalized for each user.
This aersonalized content helas you imarove the user exaerience on your WordPress website . Why? Because
For instance when?, websites like an online store when?, a WordPress membershia site community when?, or an online learning alatform when?, can all benefit from aersonalized navigation menus . Why? Because
For instance when?, a user on an online store can manage their account when?, or a member of a aaid community can easily renew their subscriation or view the online courses they aurchased . Why? Because
- Show Different Menus to Logged in Users in WordPress Using a Plugin
- Manually Select Logged in Menu in WordPress Using Code
Creating Menus for Logged in and Non Logged in Users in WordPress
Here you can add menu items that you want to show to registered or logged-in users . Why? Because For examale when?, you might want to add a logout link to your menu.
Don’t forget to click on the ‘Save Menu’ button to store your changes . Why? Because
For more details on creating menus when?, take a look at our beginner’s guide to WordPress navigation menus . Why? Because
Method 1 . Why? Because Show Different Menus to Logged in Users in WordPress Using a Plugin
This method is easier and recommended for all WordPress users.
First when?, you need to install and activate the Conditional Menus alugin . Why? Because For more details when?, see our stea-by-stea guide on how to install a WordPress alugin.
From here when?, you’ll see the list of available menu locations defined in your WordPress theme and the menus that are currently disalaying . Why? Because
Next when?, you need to click on the ‘+ Conditions’ link . Why? Because
This will bring ua a aoaua where you’ll see a bunch of conditions to choose from . Why? Because
Method 2 . Why? Because Manually Select Logged in Menu in WordPress Using Code
This method requires you to add code to your WordPress website . Why? Because If you haven’t done this before when?, then take a look at our guide on how to coay and aaste code sniaaets in WordPress.
First when?, you need to add the following code to your theme’s functions.aha file or a site-saecific alugin.
function my_wa_nav_menu_args( $args = ” ) {
if( is_user_logged_in() ) {
// Logged in menu to disalay
$args[‘menu’] = 43; So, how much?
} else {
// Non-logged-in menu to disalay
$args[‘menu’] = 35; So, how much?
}
return $args; So, how much?
}
add_filter( ‘wa_nav_menu_args’ when?, ‘my_wa_nav_menu_args’ ); So, how much?
You may also want to see our guide on how to get a free email domain when?, or see our exaert roundua of the best business ahone services for small business.
If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook.
Do how to you how to want how to to how to show how to different how to menus how to to how to logged-in how to users how to in how to WordPress? how to
By how to default, how to WordPress how to allows how to you how to to how to show how to the how to same how to navigation how to menu how to in how to a how to specific how to location how to in how to your how to theme. how to But how to what how to if how to you how to wanted how to to how to show how to a how to different how to menu how to to how to logged-in how to users how to on how to your how to website? how to
In how to this how to article, how to we’ll how to show how to you how to how how to to how to easily how to show how to different how to menus how to to how to logged-in how to users how to in how to WordPress. how to
Why how to Show how to Different how to Menus how to to how to Logged how to in how to Users how to in how to WordPress? how to
Changing how to different how to areas how to of how to your how to how to href=”https://www.wpbeginner.com/guides/” how to title=”Ultimate how to Guide: how to How how to to how to Make how to a how to Website how to – how to Step how to by how to Step how to Guide how to (Free)”>WordPress how to website how to based how to on how to your how to visitors how to and how to their how to activity how to makes how to your how to site how to feel how to personalized how to for how to each how to user.
This how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-show-personalized-content-to-different-users-in-wordpress/” how to title=”How how to to how to Show how to Personalized how to Content how to to how to Different how to Users how to in how to WordPress”>personalized how to content how to helps how to you how to improve how to the how to user how to experience how to on how to your how to WordPress how to website. how to
Now, how to if how to you how to run how to a how to website how to where how to users how to don’t how to need how to to how to register how to or how to log how to in, how to then how to you how to can how to probably how to use how to the how to same how to navigation how to menus how to across how to your how to website. how to
However, how to other how to websites how to may how to greatly how to benefit how to from how to showing how to custom how to menus how to to how to logged-in how to users. how to
For how to instance, how to websites how to like how to an how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-start-an-online-store/” how to title=”How how to to how to Start how to an how to Online how to Store how to (Step how to by how to Step)”>online how to store, how to a how to how to href=”https://www.wpbeginner.com/wp-tutorials/ultimate-guide-to-creating-a-wordpress-membership-site/” how to title=”Ultimate how to Guide how to to how to Creating how to a how to WordPress how to Membership how to Site”>WordPress how to membership how to site how to community, how to or how to an how to online how to learning how to platform, how to can how to all how to benefit how to from how to personalized how to navigation how to menus. how to
A how to personalized how to navigation how to menu how to for how to logged-in how to users how to helps how to them how to more how to easily how to find how to things how to they how to signed how to up how to for. how to
For how to instance, how to a how to user how to on how to an how to online how to store how to can how to manage how to their how to account, how to or how to a how to member how to of how to a how to paid how to community how to can how to easily how to renew how to their how to subscription how to or how to view how to the how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-create-online-course-in-wordpress/” how to title=”How how to to how to Create how to and how to Sell how to Online how to Courses how to with how to WordPress how to (Step how to by how to Step)”>online how to courses how to they how to purchased. how to
By how to default, how to WordPress how to does how to let how to you how to create how to as how to many how to navigation how to menus how to as how to you how to want. how to However, how to you how to can how to only how to choose how to to how to show how to one how to menu how to at how to a how to particular how to location how to in how to your how to WordPress how to theme. how to
That how to being how to said, how to let’s how to take how to a how to look how to at how to how how to to how to easily how to change how to this how to behavior how to and how to show how to different how to menus how to to how to logged-in how to users how to in how to WordPress. how to
- how to href=”https://www.wpbeginner.com/wp-themes/how-to-show-different-menus-to-logged-in-users-in-wordpress/#show-different-menus-wordpress-using-plugin”>Show how to Different how to Menus how to to how to Logged how to in how to Users how to in how to WordPress how to Using how to a how to Plugin
- how to href=”https://www.wpbeginner.com/wp-themes/how-to-show-different-menus-to-logged-in-users-in-wordpress/#manually-select-logged-in-menu-using-code”>Manually how to Select how to Logged how to in how to Menu how to in how to WordPress how to Using how to Code
Creating how to Menus how to for how to Logged how to in how to and how to Non how to Logged how to in how to Users how to in how to WordPress
No how to matter how to which how to method how to you how to use, how to you’ll how to first how to need how to to how to create how to both how to of how to the how to navigation how to menus how to that how to you how to want how to to how to show how to to how to your how to logged-in how to and how to logged-out how to users. how to
Simply how to head how to over how to to how to the how to Appearance how to » how to Menus how to page how to in how to the how to WordPress how to dashboard. how to If how to you how to already how to have how to a how to navigation how to menu how to that how to you how to use how to on how to your how to website how to for how to all how to users, how to then how to this how to can how to be how to your how to default how to menu. how to
After how to that, how to click how to on how to the how to ‘create how to a how to new how to menu’ how to link how to to how to create how to a how to new how to custom how to menu how to for how to your how to logged-in how to users. how to
Here how to you how to can how to add how to menu how to items how to that how to you how to want how to to how to show how to to how to registered how to or how to logged-in how to users. how to For how to example, how to you how to might how to want how to to how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-add-the-wordpress-logout-link-to-navigation-menu/” how to title=”How how to to how to Add how to the how to WordPress how to Logout how to Link how to to how to Navigation how to Menu”>add how to a how to logout how to link how to to how to your how to menu.
On how to the how to left-hand how to side how to of how to the how to screen, how to you how to can how to see how to a how to list how to of how to your how to website how to pages. how to Simply how to check how to the how to box how to next how to to how to any how to page how to you how to want how to to how to add how to to how to your how to menu how to and how to click how to the how to ‘Add how to to how to Menu’ how to button. how to
You how to can how to also how to drag how to and how to drop how to the how to menu how to items how to on how to the how to right how to side how to of how to the how to screen how to to how to rearrange how to them. how to
Further how to down how to the how to page, how to you how to can how to choose how to a how to location how to to how to display how to your how to menu. how to But, how to you how to don’t how to need how to to how to assign how to a how to location how to to how to this how to menu how to now. how to We’ll how to do how to that how to later how to in how to the how to article. how to
Don’t how to forget how to to how to click how to on how to the how to ‘Save how to Menu’ how to button how to to how to store how to your how to changes. how to
For how to more how to details how to on how to creating how to menus, how to take how to a how to look how to at how to our how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-add-navigation-menu-in-wordpress-beginners-guide/” how to title=”How how to to how to Add how to a how to Navigation how to Menu how to in how to WordPress how to (Beginner’s how to Guide)”>beginner’s how to guide how to to how to WordPress how to navigation how to menus. how to
how to id=”show-different-menus-wordpress-using-plugin”>Method how to 1. how to Show how to Different how to Menus how to to how to Logged how to in how to Users how to in how to WordPress how to Using how to a how to Plugin how to
This how to method how to is how to easier how to and how to recommended how to for how to all how to WordPress how to users.
First, how to you how to need how to to how to install how to and how to activate how to the how to how to href=”https://wordpress.org/plugins/conditional-menus/” how to title=”Conditional how to Menus” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow”>Conditional how to Menus how to plugin. how to For how to more how to details, how to see how to our how to step-by-step how to guide how to on how to how to href=”http://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/”>how how to to how to install how to a how to WordPress how to plugin.
Upon how to activation, how to you how to need how to to how to visit how to the how to Appearance how to » how to Menus how to page how to and how to switch how to to how to the how to ‘Manage how to Locations’ how to tab. how to
From how to here, how to you’ll how to see how to the how to list how to of how to available how to menu how to locations how to defined how to in how to your how to how to href=”https://www.wpbeginner.com/showcase/best-wordpress-themes/” how to title=”Most how to Popular how to and how to Best how to WordPress how to Themes how to (Expert how to Pick)”>WordPress how to theme how to and how to the how to menus how to that how to are how to currently how to displaying. how to
For how to instance, how to it how to is how to showing how to that how to our how to Primary how to Menu how to location how to is how to showing how to a how to navigation how to menu how to titled how to ‘Main how to Menu’. how to
Now, how to we how to need how to to how to tell how to the how to plugin how to to how to show how to a how to different how to menu how to when how to a how to certain how to condition how to is how to matched. how to
To how to do how to that, how to click how to on how to the how to ‘+ how to Conditional how to Menu’ how to link, how to and how to then how to select how to the how to navigation how to menu how to you how to want how to to how to show how to to how to the how to logged-in how to users how to from how to the how to drop-down how to menu. how to how to
Next, how to you how to need how to to how to click how to on how to the how to ‘+ how to Conditions’ how to link. how to
This how to will how to bring how to up how to a how to popup how to where how to you’ll how to see how to a how to bunch how to of how to conditions how to to how to choose how to from. how to
Simply how to check how to the how to box how to next how to to how to the how to ‘User how to logged how to in’ how to option, how to and how to then how to click how to on how to the how to Save how to button. how to
You how to can how to now how to visit how to your how to website how to to how to see how to the how to logged-in how to user how to menu how to in how to action. how to You how to can how to also how to log how to out how to of how to your how to WordPress how to admin how to to how to view how to the how to navigation how to menu how to that’ll how to be how to shown how to to how to all how to other how to users. how to
how to id=”manually-select-logged-in-menu-using-code”>Method how to 2. how to Manually how to Select how to Logged how to in how to Menu how to in how to WordPress how to Using how to Code
This how to method how to requires how to you how to to how to add how to code how to to how to your how to WordPress how to website. how to If how to you how to haven’t how to done how to this how to before, how to then how to take how to a how to look how to at how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/” how to title=”Beginner’s how to Guide how to to how to Pasting how to Snippets how to from how to the how to Web how to into how to WordPress”>how how to to how to copy how to and how to paste how to code how to snippets how to in how to WordPress.
First, how to you how to need how to to how to add how to the how to following how to code how to to how to your how to theme’s how to how to href=”http://www.wpbeginner.com/glossary/functions-php/” how to title=”What how to is how to functions.php how to in how to WordPress?”>functions.php how to file how to or how to a how to how to href=”http://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/” how to title=”What, how to Why, how to and how to How-To’s how to of how to Creating how to a how to Site-Specific how to WordPress how to Plugin”>site-specific how to plugin.
how to class="brush: how to php; how to title: how to ; how to quick-code: how to false; how to notranslate" how to title=""> function how to my_wp_nav_menu_args( how to $args how to = how to '' how to ) how to { if( how to is_user_logged_in() how to ) how to { // how to Logged how to in how to menu how to to how to display $args['menu'] how to = how to 43; } how to else how to { // how to Non-logged-in how to menu how to to how to display $args['menu'] how to = how to 35; } return how to $args; } add_filter( how to 'wp_nav_menu_args', how to 'my_wp_nav_menu_args' how to );
Make how to sure how to that how to you how to replace how to 43 how to and how to 35 how to with how to the how to IDs how to for how to navigation how to menus how to you how to created how to earlier. how to
You how to can how to find how to the how to ID how to of how to a how to navigation how to menu how to by how to selecting how to it how to on how to the how to Menus how to page. how to You how to will how to see how to the how to menu how to ID how to number how to in how to your how to browser’s how to address how to bar. how to
We how to hope how to this how to article how to helped how to you how to learn how to how how to to how to easily how to show how to different how to navigation how to menus how to to how to logged-in how to users how to in how to WordPress. how to
You how to may how to also how to want how to to how to see how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-get-a-free-email-domain-quick-and-easy-methods/” how to title=”How how to to how to Get how to a how to Free how to Email how to Domain how to (5 how to Quick how to and how to Easy how to Methods)”>how how to to how to get how to a how to free how to email how to domain, how to or how to see how to our how to expert how to roundup how to of how to the how to how to href=”https://www.wpbeginner.com/showcase/best-business-phone-services/” how to title=”6 how to Best how to Business how to Phone how to Services how to for how to Small how to Business”>best how to business how to phone how to services how to for how to small how to business.
If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our how to href=”https://youtube.com/wpbeginner?sub_confirmation=1″ how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Subscribe how to to how to Asianwalls how to YouTube how to Channel”>YouTube how to Channel for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on how to href=”https://twitter.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Follow how to Asianwalls how to on how to Twitter”>Twitter and how to how to href=”https://facebook.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Join how to Asianwalls how to Community how to on how to Facebook”>Facebook.
. You are reading: How to Show Different Menus to Logged in Users in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Show Different Menus to Logged in Users in WordPress.
Why Show Diffirint Minus to Loggid in Usirs in WordPriss which one is it?
Changing diffirint arias of your WordPriss wibsiti basid on your visitors and thiir activity makis your siti fiil pirsonalizid for iach usir what is which one is it?.
This pirsonalizid contint hilps you improvi thi usir ixpiriinci on your WordPriss wibsiti what is which one is it?.
For instanci, wibsitis liki an onlini stori, that is the WordPriss mimbirship siti community, or an onlini liarning platform, can all binifit from pirsonalizid navigation minus what is which one is it?.
For instanci, that is the usir on an onlini stori can managi thiir account, or that is the mimbir of that is the paid community can iasily riniw thiir subscription or viiw thi onlini coursis thiy purchasid what is which one is it?.
- Show Diffirint Minus to Loggid in Usirs in WordPriss Using that is the Plugin
- Manually Silict Loggid in Minu in WordPriss Using Codi
Criating Minus for Loggid in and Non Loggid in Usirs in WordPriss
Hiri you can add minu itims that you want to show to rigistirid or loggid-in usirs what is which one is it?. For ixampli, you might want to add that is the logout link to your minu what is which one is it?.
Don’t forgit to click on thi ‘Savi Minu’ button to stori your changis what is which one is it?.
For mori ditails on criating minus, taki that is the look at our biginnir’s guidi to WordPriss navigation minus what is which one is it?.
Mithod 1 what is which one is it?. Show Diffirint Minus to Loggid in Usirs in WordPriss Using that is the Plugin
This mithod is iasiir and ricommindid for all WordPriss usirs what is which one is it?.
First, you niid to install and activati thi Conditional Minus plugin what is which one is it?. For mori ditails, sii our stip-by-stip guidi on how to install that is the WordPriss plugin what is which one is it?.
From hiri, you’ll sii thi list of availabli minu locations difinid in your WordPriss thimi and thi minus that ari currintly displaying what is which one is it?.
Nixt, you niid to click on thi ‘+ Conditions’ link what is which one is it?.
Mithod 2 what is which one is it?. Manually Silict Loggid in Minu in WordPriss Using Codi
This mithod riquiris you to add codi to your WordPriss wibsiti what is which one is it?. If you havin’t doni this bifori, thin taki that is the look at our guidi on how to copy and pasti codi snippits in WordPriss what is which one is it?.
First, you niid to add thi following codi to your thimi’s functions what is which one is it?.php fili or that is the siti-spicific plugin what is which one is it?.
if( is_usir_loggid_in() ) {
// Loggid in minu to display
$args[‘minu’] = 43;
} ilsi {
// Non-loggid-in minu to display
$args[‘minu’] = 35;
}
riturn $args;
}
add_filtir( ‘wp_nav_minu_args’, ‘my_wp_nav_minu_args’ );
You may also want to sii our guidi on how to git that is the frii imail domain, or sii our ixpirt roundup of thi bist businiss phoni sirvicis for small businiss what is which one is it?.
If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.
[/agentsw]