While many membership or subscription plugins give you the ability to protect entire pages or portions of your content so that inactive subscribers or guests can’t access them, they don’t always give you control over your menu display. If non-members can’t access a particular page, you may not want it displayed in your navigation to them since the page won’t be useful.

Likewise, some pages are not useful members (such as pages intended to sell subscriptions to guests), and these can be hidden from active subscribers. To respond to these situations, you can conditionally adjust your menu based on user role.

This tutorial comes from a great idea from Member Up on using the If Menu plugin to control menus for members. We’ll adapt this to be specific to WooCommerce today, as WooCommerce Subscriptions is commonly used for membership-type sites and automatically adjusts roles.

WooCommerce Subscribers: Overview

This tutorial will let us create menus that respond to a WooCommerce subscriber’s status. When a subscriber has an active subscription, you can determine which role they have, and can set another role for inactive status. This will let us conditionally show / hide menu items based on subscriber status.

Here are the plugins we’ll reference in this article:

First, make sure you have at least If Menu and WooCommerce Subscriptions installed.

WooCommerce Subscribers: Configure Active / Inactive Roles

Under WooCommerce > Settings > Subscriptions, you can set up the roles that active / inactive subscribers will have. By default, active subscribers will have the subscriber role, while inactive subscribers will have the customer role.

WooCommerce Subscriptions roles

Select active / inactive roles

If you want to set up custom user roles, you can do so with another free plugin: User Role Editor. This will let you create new roles, so you could create a “Member” role by cloning the customer or subscriber roles.

Note these roles, as we’ll use them to show or hide certain menu items.

WooCommerce Subscribers: Configure Menu Items for Membership

Next, you can go to Appearance > Menus. When you create your menus, you can now enable conditional logic based on your user roles or a couple of other conditions.

If you want to show a menu item to your active subscribers, but no one else, choose “Show” if “User is Subscriber”.

WooCommerce subscriber page

(Note that your site admins will see any page restricted to other roles, i.e. navigation items only shown only to subscribers, so to test this you should use a different browser or user account.)

When a guest or an inactive subscriber views the site, this menu item will not be shown.

WooCommerce non-member menu

When logged in as an active subscriber, customers will see your subscriber-only menu item.

WooCommerce member menu

This can let you show items in the navigation to your active subscribers only, such as information about their subscription or membership. This does not restrict the page from direct access; rather, it only controls menu visibility.

WooCommerce Subscribers: Configure Menu Items for Guests

You can also show items to non-logged in users only. Select “Hide” if “User is logged in” for your menu item that should be for guest users only.

WooCommerce Guest menu

Non-subscriber item

This is a great way to include an upsell or sales page for your subscription / membership, but it will be removed for logged-in users so the sales page doesn’t distract logged in users.

WooCommerce Subscribers: Active Subscriber Menus

Changing your navigation or other menus to respond to user statuses is a good way to make sure that active subscribers will have access to pages they need without the need to directly show these pages to your inactive subscribers or guests.

You can also show pages only to guest users, letting you upsell your membership or subscription without it getting in the way of your existing subscribers.


Note: This post may contain affiliate links, which means we get a commission from the plugin, theme, or service provider if you choose to purchase. Regardless of this, we are committed to providing high quality, unbiased resources. Have more questions? See our affiliate policy. You can use the plain links below if you prefer that we not receive a referral commission:
Articles you may also like:

Posted by Beka Rice

Beka Rice manages the direction of Sell with WP content and writes or edits most of our articles to share her interests in eCommerce. Or she just writes as an excuse to spend more time jamming out to anything from The Clash to Lady Gaga. Who knows.

2 Comments

  1. This is great… thanks for the share. I had done a ad-hoc of this way back on my first membership site with WooDoJo, show/hide menu… but it wasn’t this seamless.

    Bookmarked and saved to Evernote 😀

    Reply

  2. Awesome! I’ll be adding this soon.

    Reply

Leave a reply

Your email address will not be published. Required fields are marked *