Building a Membership Website with WordPress: Part 4
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
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.
The following customization are applicable to our aim
Dashboard User Access:
Administrators only, this means literally only the website administrators will be able to login to the website dashboard area.Redirect URL: This field is used to specify the page to redirect non administrative users who try to login from the
wp-adminarea.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
- Register a new user account from the front-end. Just visit the
Login/Registrationpage on your website.
- If the registration was successful you'll see something like the notification in the picture below.
- Enter your details into the provided fields to login, upon successful login you'll be redirected to the page in the picture below
On this page we can test whether user
Johnboscohas access to thewp-adminarea by clicking the site title on the on the topmost bar appearing at the top-left in the case of this tutorialPayment 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
Posted on Utopian.io - Rewarding Open Source Contributors




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
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
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