How to Create a Membership Site
Building a membership site in WordPress is quite easy with proper set of plugins – you heard it right, it is not possible or very difficult to create a proper membership site with a single plugin.
I shall create a membership system which will protect some areas of your website. This article will describe login & logout to the restricted area of the website from front end and briefly touch online registration option also. For the sake of simplicity, I shall create a membership system with only two levels – Free & Premium. Same way you will be able to create multiple levels of membership.
- Membership 2: This is the main membership plugin.
- Clean Login: Login / Logout form – we shall use only login part.
- Nav Menu Roles: Display / hide individual menu options.
- BAW Login/Logout menu: Add login / logout in WordPress menu options – we shall use logout part.
- Install & activate all the above mentioned plugins. On activation of Membership plugin it will show a window to Switch to Membership2 (Image 1). You have to accept the option. So, click on I understand. Switch to Membership2 now!* button.
- Create a couple of users with different roles to test the system.
- Create a list of menu options & pages that you want to protect.
- Go to Appearance -> Menus. Open details of each menu item and you will find Display Mode below Navigation Level. Select Logged In Users for the menu options you want to protect. Rest keep to Everyone (Image 2). On selection of Logged In Users, all available user roles will be displayed. Select only the type of users that you want to give access to the particular menu option. After making changes to all the menu options, save the menu.
- Now we are going to put Logout option to the menu. This option will be available to logged in users only. With the usual menu options available in the Appearance -> Menus section in the WordPress Dashboard, you will find a new set of options named Login/Logout links v1.3.3 are added at the bottom of the list. Choose Log Out option and Add to menu and at the same time, make Display Mode to Logged In Users for this particular menu option Log Out. Choose all user roles for this particular menu option (Image 3). Again Save Menu.
- If you run the system, in this condition, you will find Log Out option available in the menu. Selecting which, you will get the WordPress log out screen. To make the option more professional looking, we will use Clean Login plugin. Go to Settings -> Clean Login in WordPress Dashboard. You will find a lot of options there, but we are interested only to the Redirections section. Choose Redirect after log out? and select Save Changes button just below the option (Image 4).
- You have created a Logout option in the frontend. Now it’s time to create a Login option also. Create a new page and put the following shortcode in it: [clean-login]. Add this page to menu and set Display Mode of this particular menu option to Logged Out Users (Image 5).
- To check the operation, open the page and if you are still logged in, you will find a Log out option in the menu. You will also see that all the menu options are active. Now selecting Log Out will log you out and take you to the Home page. You will find the protected menu options are disappeared and Log Out is replaced by Login. Selecting Login will open a login page (Image 6). On successful login, the system will show a welcome message and will stay on the same page (Image 7). If you do not want this and want to redirect to another page after login, go to Settings -> Clean Login in WordPress Dashboard and select the option Redirect after log in? option. You may define a specific page to redirect (Image 8).
- This concludes the setting of Login, Log Out & Menu options. Now we shall create the membership part. When you open Membership 2 from Dashboard for the first time, it will show an option of importing membership data (Image 9). Check mark Replace current content with import data (removes existing Memberships/Members before importing data) and click Import button.
- After the importing is completed, You will see welcome message of Membership 2 plugin. Click on Let’s get started big blue button. Create New Membership page will open (Image 10). Standard Membership option is already selected. provide a name at Name Your Membership: area and select Save and continue. A congratulation page will appear (Image 11). Select Finish button.
- Go to Membership 2 -> Protection Rules in the Dashboard. Set-up Protection Rules page will open with default Pages tab (Image 12). You will find a list of all the pages available in your website. Beside each page, Everyone is written. Place the mouse pointer to the Everyone term beside the page name you want to protect and a hyperlink with a padlock symbol will appear (Image 13). Click on it and options with available memberships will appear (Image 14). Select the membership name. Selection will be saved automatically.