Drupal - How can I create a menu link that shows only to authenticated users?

Long story short, you create 2 different Menu versions and give each version different visibility rules.

All you gotta do is configure your menu link block

enter image description here

Then in Roles, check mark ☑ Authenticated users and you may want to also ☑ Administrator

enter image description here

Now create another Menu (/admin/structure/menu) which does not have the "add node" link. Then go to blocks (/admin/structure/block) in Primary Menu (Assuming you're using Bartik, may have a different name if you're using a custom theme) click add, and add the Menu you just created and configure it.

This time for Roles, only check mark ☑ Anonymous

PS: In pages you can restrict so it only shows up in certain pages.


An "add node" menu link is only shown to users who have the permission to create such node. So if you give the permission to authenticated users, and not to anonymous users, you're done.

If you have other samples of links that have a related permission, then use a similar approach for that permission (don't grant it to anonymous users). If some link doesn't have such permission, then go for the approach described in the answer from @No Sssweat.

Tags:

Users

8