Building a Membership Website with WordPress: Part 4

in #utopian-io8 years ago (edited)

What Will I Learn?

This post is fourth in a series of posts on how to build a membership website with WordPress.

Below are the links to the earlier posts

In earlier posts we talked about how to set customization and add common membership website features such as content blocking, login/registration page creation, dialogs and error messages among others.

In this post we will be learning how to restrict users without administrative privileges from the dashboard area of the website.

Practically, what will be happening is that whenever a user tries to gain access to the dashboard through the wp-login.php page the user will be redirected to another page specified by the admin.

Requirements

  1. WordPress Installation

  2. WP-Member Plugin

  3. Remove Dashboard Access Plugin

WordPress Installation

You should have a working WordPress installation to test run the activities of this tutorial.

To learn more about installing WordPress read this post.

WP-Member Plugin

In the first post of this series I gave a brief overview of what this plugin is about, you can check out the post here.

Remove Dashboard Access Plugin

We will be using this plugin to limit user access to the admin area. That privilege will be reserved for users with admin user roles.

The plugin is available for free download here.

Difficulty

Basic

Customizing the Site

Restricting Access to the wp-admin Area

So why do we want to prevent users that are not admin from having access to the wp-admin area.

The reason for this is simple, we don't want users with no moderation responsibilities to gain access to the back-end and tinker with the setup.

To achieve our aim what we have to do is install and customize this free plugin known as Remove Dashboard Access.

  • Download the plugin from the link above, install and activate. After activation, to access the settings area of the plugin from the admin bar, go to Settings > Dashboard Access.

enter image description here

The following customization are applicable to our aim

  1. Dashboard User Access: Administrators only, this means literally only the website administrators will be able to login to the website dashboard area.

  2. Redirect URL: This field is used to specify the page to redirect non administrative users who try to login from the wp-admin area.

  3. User Profile Access: Will prevent users from being able to directly edit their profiles in the dashboard.

To check whether the plugin was successful in restricting non-admin users from the wp-admin area we will conduct a test.

The procedure for this test is

  1. Register a new user account from the front-end. Just visit the Login/Registration page on your website.

enter image description here

  • If the registration was successful you'll see something like the notification in the picture below.

enter image description here

  • Enter your details into the provided fields to login, upon successful login you'll be redirected to the page in the picture below

enter image description here

  • On this page we can test whether user Johnbosco has access to the wp-admin area by clicking the site title on the on the topmost bar appearing at the top-left in the case of this tutorial Payment Portal Demo.

    If the plugin is working correctly you'll be directed to page specified in the plugin.


You can check out other contributions from me on here

  1. Building a Membership Website on WordPress: 1

  2. Building a Membership Website on WordPress: 2

  3. Building a Membership Website on WordPress: 3



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

In your next tutorial please don't add your previous posts to the "What Will I Learn?" section, since you already have them at the end of your post as well.

You can contact us on Discord.
[utopian-moderator]

Hey @gotgame I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.04
TRX 0.32
JST 0.077
BTC 65812.53
ETH 1719.32
USDT 1.00
SBD 0.41