Want to hide menu items on your membership site?
I help a few companies with some coaching. In the course of doing that, I often introduce some of my frameworks. And it dawned on me that it would be easy and clean to create a spot on my website where coaching clients could log in (membership site) and get direct access to the list of files. I'd put that link in the header, but that means I now want to hide menu items based on who is visiting my site.
So how do you do it?
I'm going to show you – and no, it doesn't require any code at all.
You have to protect pages and hide menu items
Just to be clear, there are two things you have to do. First you have to create a membership where you assign people to roles that do or do not have access to your content. Second you have to hide menu items that aren't available to people in the wrong role.
It's important to break out the two distinct efforts or you'll hide a menu item that others can still find and share, and people will see content you wanted hidden.
What's the best membership plugin for this? Totally depends. That's why I created the comparison of membership plugins to help you decide.
So this is part one.
- Pick a membership plugin.
- Create a membership role.
- Apply protection to a particular page.
- Add a menu item to that page.
But you don't want that item to be presented to people who don't have access, right?
In fact, you might want another menu item if you want to sell access to the membership (and only show it to people who aren't in the other role you created). But that's outside the scope of what I'm talking about here.
Part two is the use of another plugin that hides menu items based on user role.
The one plugin you need
There's a simple plugin that does all the work for you. It's called Nav Menu Roles.
What it does is allow you to make a menu item only visible based on user roles. Membership plugins often put users into roles, so it's a perfect solution for what you want.
Now, before I go further, I need to tell you that changes to WordPress have meant that sometimes your site's theme and the membership plugin you choose could create an issue for this plugin.
It's not the fault of this plugin. It's the change to WordPress and not all themes and plugins have kept up. That said, the plugin has great support and they have workarounds if your site is caught into one of these few exceptions.
With that said, let me show you how this works. It's super easy.
So in my case, I could say that I want my “Frameworks” page to only be visible to logged in users, and then add that they have to be in a new role that I created for my customers, called “Coaching Clients.”
Once I do that, only people logged in, and in the right role, will see the menu item in the main navigation. No one else will ever see it.
That's what I call perfect! And did I mention it's free?
Sign up for free content. People still do that.
Thousands of folks (7000+) regularly get my posts in their inbox. For free.