How to Restrict WordPress Pages by User Role

Do you want to restrict WordPress pages by user role? Many WordPress businesses need to control which users can access certain pages on their websites. In this article, we will show you how to easily restrict access to certain WordPress pages by user role. Restricting… Read More »

The post How to Restrict WordPress Pages by User Role appeared first on WPBeginner.

Do you want to restrict WordPress pages by user role? Many WordPress businesses need to control which users can access certain pages on their websites. In this article, we will show you how to easily restrict access to certain WordPress pages by user role.

Restrict Content by User Role

Restricting WordPress Pages by User Role

By default, WordPress comes with a limited set of tools to restrict content on your website. You can create private and password protected posts, but these features don’t allow you to limit access by user role.

Luckily, there are several WordPress plugins that allow you to do just that. You can choose one of them to restrict pages to certain users, user groups, or user roles.

Using these plugins, you can create a membership website, pay-per-view websites, or even family blogs. You can also monetize your content by adding paid subscriptions.

That being said, let’s take a look at how to properly restrict WordPress pages by user role. We will be showing you different plugins, you can choose the one that best suits your needs.

1. Restrict Content Pro

Restrict Content Pro

Restrict Content Pro is a great option to control who has access to your website content. It also allows you to add paid subscriptions and make money online from your membership website.

First, you will need to install and activate the Restrict Content Pro plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit Restrict » Settings page to enter your license key. You can get this key from your account on Restrict Content Pro website.

Enter your license key

Next, you need to switch to the payments tab to select a payment gateway.

Restrict Content Pro allows you to accept payments through PayPal, Stripe, 2Checkout, Braintree, and Authorize.net.

Payments

After selecting a payment method, you will be able to add credentials for each Payment method.

Don’t forget to click on the save options button to store your settings.

Now you need to edit the pages or posts you want to be restricted by user roles.

On the edit screen, scroll down to ‘Restrict this content’ meta box and select ‘Members with certain role’ option.

Restrict content by user role

Choose the user role you want to allow and then update or publish your content.

Restrict Content Pro also allows you to create subscription levels. For more detailed instructions, see our guide on how to restrict content to registered users in WordPress.

2. MemberPress

MemberPress

MemberPress is one of the best WordPress membership plugins in the market. It allows you to easily create membership websites with paid subscriptions.

First you will need to install and activate the MemberPress plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, head over to MemberPress » Activate page to enter your license key. You can find this information from your account on MemberPress website.

MemberPress license key

Next, you need to click on the Add-Ons tab and install ‘WordPress User Roles’ add-on.

User role addon

After installing the user role add-on, you need to head over to MemberPress » Options page. Click on the payments tab to set up payments.

Set up payment gateway for MemberPress

MemberPress supports PayPal (Standard, Express, and Pro), Stripe, and Authorize.net out of the box. Select the payment methods you want to use and provide the required credentials.

Next, you need to visit MemberPress » Memberships page and click on the ‘Add New’ button to create a membership plan.

Creating a membership

You will start by providing a title for this membership plan and set pricing, billing type, and expiration settings.

After that, scroll down to the ‘Membership Options’ meta box below the post editor. This is where you can setup different options for this particular membership plan.

Membership options

Click on the ‘Advanced’ tab under membership options and choose a user role for this membership plan.

Select user role for membership plan

Be careful when choosing a user role as each user role in WordPress comes with its own permissions. If you need you can also create a custom user role for the membership plans on your website.

You can now publish your membership plan.

If you want to add more membership plans, then you can repeat the process to add them.

Once you have created membership plan(s). It is time to set up rules to restrict access to the content.

Head over to MemberPress » Rules page and click on the Add New button at the top.

This will bring you to the rules edit page where you can select different conditions and associate them to a membership plan.

Setting rules

For example, you can select all content that matches a particular tag or category to be available only to members with a membership plan you created earlier.

Lastly, you need to edit the content you want to restrict and add it to that particular category or tag.

That’s all, you have successfully restricted pages in WordPress by user role and membership.

3. LearnDash

LearnDash

LearnDash is the best WordPress LMS plugin. It allows you to create and sell courses online.

It comes with built-in subscriptions allowing users to enroll into a course before they can see its contents. This enables you to restrict access to course pages and monetize your website.

First thing you need to do is install and activate LearnDash plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit LearnDash LMS » Settings page and click on the LMS License tab. Enter your LearnDash account email address and license key, and then click on ‘Update License’ button to save it.

LearnDash license

Next, you need to switch to the ‘PayPal Settings’ tab to enter your PayPal email address.

LearnDash payment

By default, LearnDash only offers PayPal payment gateway. Stripe and 2Checkout are available as extensions.

Now you can go to LearnDash LMS » Courses page and click on the ‘Add New’ button to add your first course.

Add new course

Enter a title and description for your course. The description part will be visible to all users to explain what this course is about.

Add course title and description

After that you need to scroll down to the course options meta box. Under the course price type option, you can select an access option for the course.

The plugin allows you to create open (public) or closed courses, free, buy bow, and recurring price types.

Course options

For free courses, your users will still need to enroll into course by creating account.

You can now save or publish your course and preview it on your website.

Preview course page

Now that you have created a course, it is still empty. To fill it up you will need to add the course contents like lessons, quizzes, and assignments.

LearnDash is a powerful tool to sell online courses while restricting access to content. It works really well with MemberPress to create subscription plans that automatically give users access to different courses.

That’s all for now. We hope this article helped you learn how to easily restrict WordPress pages by user role. You may also want to see our ultimate step by step WordPress security guide for beginners.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Restrict WordPress Pages by User Role appeared first on WPBeginner.

How to Restrict Content to Registered Users in WordPress

Do you want to restrict some of your content to registered or paid users only? Often bloggers use subscriptions or one-time payment model to monetize content on their websites. In this article, we will show you how to restrict content to registered users in WordPress.… Read More »

The post How to Restrict Content to Registered Users in WordPress appeared first on WPBeginner.

Do you want to restrict some of your content to registered or paid users only? Often bloggers use subscriptions or one-time payment model to monetize content on their websites. In this article, we will show you how to restrict content to registered users in WordPress.

Restricting content to paid and registered users in WordPress

We will be using Restrict Content Pro which we believe is an awesome plugin to create a full fledged membership website with paid subscriptions.

Why Use Restrict Content Pro?

Restrict Content Pro is the premium version of an awesome free plugin with the same name Restrict Content.

If you do not want to purchase the pro version, then you can simply download the free version which has limited support and features.

Here is why we have chosen Restrict Content for this guide:

  • Restrict Content Pro is extremely easy to install, set up and use.
  • The code behind the plugin is clean and poetic.
  • You can create unlimited subscription packages with multiple levels
  • You can accept payments using PayPal, Stripe, Braintree, and 2Checkout.
  • It allows you to easily create login, signup, user account pages.
  • You can create unlimited number of discount codes.
  • The easy to use reporting shows you how your site is performing.

Setting up Restrict Content Pro in WordPress

First thing you need to do is install and activate Restrict Content Pro. Upon activation, this plugin adds a new menu item labeled ‘Restrict’ in your WordPress admin sidebar.

Before we move on to plugin settings, lets start by creating a sign in, register, and manage subscriptions pages in WordPress.

First page you need to create is the login page.

Simply go Pages » Add New to create a new WordPress page. You can give your page any title that you want and enter [login_form] shortcode in the content area. After that, go ahead and publish your page.

Repeat the procedure to create a registration page with [register_form] shortcode in it.

When a user signs up for a subscription plan, they will be redirected to a confirmation page. This could be any page on your website with any content. You can simply create a page thanking users for signing up on your website. This page does not need any shortcode.

Lastly, you need to create a page where users will be able to see their subscription plan and account details. Create a page with the shortcode [subscription_details] to display user subscription details.

Once you have created the required pages, it is time to set up Restrict Content Pro settings.

Go to Restrict » Settings, and you will land on the plugin’s General settings page.

Restrict Content Pro - General settings page

The first option here is to provide your plugin license key which is required for plugin updates and support.

Next, you need to select your registration, success, account management, and billing update pages.

After that, you need to click on the payments tab to configure your payment gateway. You will be asked to choose a currency and then select your payment gateways. Yes, you can have more than one.

You will see a checkbox to enable sandbox mode. Keep it checked until your site is ready for launch and accept payments.

Setting up payments in Restrict Content Pro

Each payment gateway has different configuration settings. You will need to provide your PayPal email address for PayPal Standard. You will need API keys if you are using PayPal Pro or Express. Similarly, you will need API keys for other gateways too. You can obtain these keys by logging into your account on your payments service provider.

The emails tab on the settings page allows you to modify the emails sent out by the plugin. If you are having trouble recieving emails, then check out our guide on how to fix WordPress not sending emails issue.

Misc settings

There are some important options available under the Misc tab on settings page. You can setup login page redirects, disable account sharing, Form CSS, send IPN emails, and setup reCAPTCHA for registration form to prevent spam registrations.

Creating Subscription Levels in Restrict Content Pro

Now we are ready to create Subscription levels for your restricted content. As the name suggest, it allows you to create different level of subscriptions for your content.

For example, you can create a subscription level ‘Premium’ and set a price for it. When you are restricting content on your website, you will be able to choose the subscription level a user must have in order to access the restricted content.

Adding new subscription level in Restrict Content Pro

Creating a subscription level in Restrict Content Pro is simple. Give your subscription level a title, description and set a price for it. You can set the price to zero if you want to create a subscription level for registered non-paying users.

You can choose the duration of a subscription level or set it to 0 to make the duration unlimited. Lastly, you need to set the status to Active, so this subscription plan is active and available on sign up form. Like this:

Registration page with your Restrict Content Pro subscription levels

Restricting Content in WordPress using Restrict Content Pro

Restrict Content Pro allows you to restrict content on a post by post basis. Under each new post, custom post type, or page, you will see a Restrict this content box with options to control who can see that particular post.

Restricting content for a post in WordPress

You can choose to restrict content based on user’s role, access, or subscription level. You can even hide contents within a post using the restrict shortcode like this:

[restrict] Your restricted content goes here... [/restrict]

Managing Memberships in Restrict Content Pro

To manage memberships in Restrict Content Pro, go to Restrict » Members. You can click on each member to view their membership details, payments received, and the status of their account.

You can also deactivate a member’s subscription at any time. This will not delete their account from your website however their subscription will be canceled, and they will be required to renew it.

Manage members in Restrict Content Pro

You can manage payments by going to Restrict » Payments. This will show you the payments you have received. With each payment, you will see the user name, their subscription plan, amount and date. All the payment data can also be exported in CSV format under Restrict » Export page.

Payments overview

Adding Discount Codes For Subscriptions with Restrict Content Pro

Restrict Content Pro allows you to offer discount codes for your promotional activity to increase user signups.

Adding a discount code is very simple. Go to Restrict » Discount Codes and simply fill in the form to create a new discount code. You can offer a flat amount discount, or a percentage discount. You can also set an expiration date for each discount code you create, and even limit the number of times a discount code can be used.

Offering discount codes in Restrict Content Pro

We hope that this article helped you restrict content to registered users with WordPress and Restrict Content Pro. You may also want to see our comparison of 5 best drag and drop page builders for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Restrict Content to Registered Users in WordPress appeared first on WPBeginner.