WordPress Member Directory Plugin + Community (CMEDC) + WordPress Restricted Site Access (SAR) - Use Case - How to Allow Access to the Expert Directory to Logged-in Users Only


Use Case - How to Allow Access to the Expert Directory to Logged-in Users Only

Back to User Guides

This guide requires:

Introduction

The WordPress Member Directory plugin enables you to create a comprehensive listing of experts or members. 

The Community add-on lets other users (logged-in or not) create and manage their expert profiles.

WordPress Restricted Site Access is a plugin that allows you to create a membership and content restriction solution. The content restriction is based on user WordPress roles and if they are logged in or not. Choose which post type, category or even specific page should be locked - and to whom. In this use case we will use it to restrict access to the expert directory.

Use Case Front-End

Restricting expert pages:

Restricting expert pages - WordPress Staff Directory Plugin
Restricting expert pages

Restricting directory index page:

Restricting directory index page - Content Control WordPress
Restricting directory index page

Restricting menu items:

Restricting menu items - WordPress Plugin for Member Directory
Restricting menu items

Use Case Assumptions

In this example use case guide, we'll cover how to allow only logged-in users to access a listing on your site.

We consider that you have already bought all of the listed plugins and add-ons, but not installed them yet.

It follows:

Installing the Plugin

The process is the same for all CM plugins and add-ons.

CreativeMinds Customer Account Dashboard - Downloads tab
CreativeMinds Customer Account Dashboard
  • Download the plugin from your customer dashboard.
  • Log in to WordPress and navigate to the WordPress Admin → Plugins settings.
  • Click on Add New.
  • Activate it and add the license.

Learn more: Getting Started - Plugin Overview


Initial Conditions

Before restricting access to your expert directory, it’s important to understand the default structure of the plugin’s pages and access rules.

Once the WordPress Member Directory plugin and Community add-on are installed and configured, you can find links to the index page and the suggestion form page at the top of the of the plugin settings:

Directory links - WP Member Directory Plugin
Directory links

For easier access, you can also add these links to your site’s menu, ensuring users can quickly navigate to the directory and suggestion form pages:

Adding links to the site menu - WordPress Employee Directory
Adding links to the site menu

By default, both the index page and expert pages are accessible to all site visitors. The access to the expert suggestion form can be limited to specific user roles only.

The index directory page and the page with the suggestion form are standard WordPress pages that contain shortcodes to output the content. Expert pages are custom post type pages. For both of these cases we will use different methods of restrictions.

With these default settings in mind, let’s proceed to configure restrictions, ensuring only logged-in users can access the directory and related pages.

How to Restrict Expert Profiles

Let's start with restricting the access to expert pages to logged-in users only.

To do this, navigate to Admin Dashboard → CM Site Access Restriction Pro → Settings → General tab.

Navigation to the plugin settings - Page Restriction WordPress
Navigation to the plugin settings

First, we can configure basic settings. A few settings that we are going to consider now are:

General restriction settings - WordPress Restrict Content
General restriction settings
  • Restriction type - Here you can choose the way how to restrict the content - fully or partially (allows to show either only certain % at the beginning of the page, or hide specific parts). For our use case we are going to hide full content of the chosen pages, so we choose Restrict full content. Once the not allowed user visits a restricted page, he will see a relevant message.
  • Access Denied page URL - As an alternative to just showing a restriction message to not allowed users, you can redirect them to the specific page.
  • Login page URL - Another alternative to showing a restriction message, you can redirect users to the login page.

If you are not going to redirect users to another page when they visit restricted page, you can customize the message that they will see. It can be done under the Labels tab, in the first option access_denied_text.

Changing the label - Content Gate
Changing the label

Now head to the Post Types tab. This tab has a list of all actual post types used on your site, and you can define restrictions specifically for each post type.

Navigation to the post types restriction settings - Content Dripping WordPress Plugin
Navigation to the post types restriction settings

Scroll down and find the post type Expert. Choose the option Access restricted to logged-in users and save the settings. Now guest users will not be able to access expert pages.

Enabling restriction for specific post type - Tiered Membership
Enabling restriction for specific post type

Front-end result:

Front-end result - WordPress Members Directory
Front-end result

How to Restrict Expert Directory Index Page

Now let's restrict the access to the index directory page. To restrict the access for a specific page, start editing it.

Editing the directoy index page - WordPress Staff Directory Plugin
Editing the directoy index page

The WordPress Restricted Site Access plugin provides a metabox for overriding global restriction settings. Find the metabox Site Access Restriction and choose the option Access restricted to logged-in users. Then click Update to save the changes.

Enabling restriction for the page - Tiered Membership
Enabling restriction for the page

After that, guest users will not be able to access the directory index page.

Front-end result:

Front-end result - Content Control WordPress
Front-end result

How to Restrict Suggestion Form

The Member Directory Community add-on has an option to define which user roles are allowed to suggest new experts and edit them. To configure it, navigate to Admin Dashboard → CM Expert Directory Pro → Settings → Community Expert tab.

Navigation to the community settings - WP Member Directory Plugin
Navigation to the community settings

Scroll down and find the option Who can add a expert. So, to allow the access to logged-in users only, choose all needed user roles except Anonymous, then save the changes.

Selecting who can add new experts - WordPress Employee Directory
Selecting who can add new experts

As a result, when guest users visit the page for suggesting experts, they will see a message that informs about the list of allowed user roles:

Front-end result - WordPress Members Directory
Front-end result

Additionally, we can restrict this page the same as the directory index page. We can do it either using a metabox when editing a page, or we can use one more method that the WordPress Restricted Site Access plugin provides.

Navigate to Admin Dashboard → CM Site Access Restriction Pro → URL Filters.

Navigation to URL filters - Page Restriction WordPress
Navigation to URL filters

This page allows you to restrict access to some page based on its URL. Click Add new filter, and add needed URL to the relevant field - it also accepts simplified URL form, so it's not necessary to provide full URL that includes the site domain. The choose Access restricted to logged-in users and click Save filters.

Adding a URL filter - WordPress Restrict Content
Adding a URL filter

Now this page is restricted similarly to expert pages and directory index page.

Front-end result:

Front-end result - Content Gate
Front-end result

If you added links to the directory index page and page for suggesting experts to your site menu, and don't want to display them to guest users, the WordPress Restricted Site Access plugin has options to achieve it.

Navigate to Admin Dashboard → Appearance → Menus.

Navigation to the menus settings - Content Dripping WordPress Plugin
Navigation to the menus settings

Expand needed menu item and find the option Visible for. Here you can choose if to show it to all users, logged-in users or guest users only. Choose Logged In Users.

Setting up a visibility for a menu item - Tiered Membership
Setting up a visibility for a menu item

When the option Logged In Users is chosen, you can also choose if to make the menu item visible to all logged-in users or to specific user roles only. In our case we choose the option All roles. Let's do it for both pages - directory index page and page for suggesting experts. Don't forget to click the button Save Menu to save the changes.

Additional visibility settings - Content Control WordPress
Additional visibility settings

Front-end result:

Front-end result - WP Member Directory Plugin
Front-end result

End Result

Following instructions found in the plugin and guides, you should be able to successfully restrict access to the expert directory and its related features, ensuring only logged-in users can view or interact with the directory..

Use Case Front-End

Restricting expert pages:

Restricting expert pages - WordPress Employee Directory
Restricting expert pages

Restricting directory index page:

Restricting directory index page - WordPress Restricted Site Access
Restricting directory index page

Restricting menu items:

WordPress Members Directory
Restricting menu items

More information about the WordPress Member Directory Plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.