To hide any button in your wordpress website for logged in users you need to add a css class called “.logged-in” into your theme additional css in the customize page.
The class “logged-in” is already idenefied on wordpress as “only for logged in users” and it can be used to hide any button on your website for logged in users.
Here is an examble:
Hide menu item if user is logged in
You can also use “.logged-in” class to hide items from your website menu only for logged in users. All what you need to do is to add it before the code of the item you are targeting. Here is an example
How to hide a menu items for logged in users by using a plugin
If you don’t want to use css codes you can install a wordpress plugin called If Menu – Visibility control for Menu Items. it will help you to hide or show any item on your menu when a user is logged in.
After you install it, you go to your menu from appearance → menus
Then you can hide or show each item when a user is logged in by doing these steps:
- Click on the item that you want to hide from your menu, then click on “enable visibility” button.
- Change the first option from “show” to “hide”
- Click on “is Administrator” and change it to “is logged in”