BEGINNER'S GUIDE

How to Restrict Content in WordPress to Non Registered Users? (5 Ways)

Last Updated: 12 mins By: Pratik Budathoki

Tired of your valuable content being available to everyone?

Well, not anymore. In this tutorial, we’ll walk you through the step-by-step process of restricting content in WordPress to non registered users.

We assure you this is what you’ve been looking for!

Prerequisites for Content Restriction

First, we’ll require a plugin that allows user registration and a content restriction feature.

User Registration Plugin

The User Registration plugin lets you register users on your website through your forms.

First, visit the User Registration website, choose a plan that suits your needs, and download the plugin from your account page.

After installing it on WordPress, follow the setup wizard for a quick and easy configuration. If you prefer a more detailed guide, check out the article on installing and setting up the plugin.


Content Restriction Addon

The Content Restriction addon from User Registration will allow us to restrict content on our website.

Let’s first enable the Content Restriction feature.

  • User Registration to Extensions - Restrict Content
  • Content Restriction Addon Activation - Restrict Content
  • Go to User Registration >> Extensions.
  • Search for “Content Restriction” on the search bar and install the addon by activating this toggle.

Then, you’ll have to enable Content Restriction for the User Registration plugin.

  • User Registration to Settings to Content Restriction
  • Enable Content Restriction
  • Go to User Registration >> Settings >> Content Restriction
  • Click on this toggle to activate it. 

Now, go to User Registration >> Content Rules

User Registration to Content Rules - Restrict Content

Click on the Add New button. 

Add New Content Rule - Content Restriction

You’ll encounter this popup. Give a name for your set of rules, which will help you identify and select whether you want to provide access or restrict this rule. 

Content Rules Popup - Restrict WordPress Page

You can change both of them later, too. 

After that, you’ll enter this window. The first stage is labeled Conditions & Logics, where you can select who can gain access or get restrictions.  

Conditions and Logics - Content Restriction

You may use the OR, AND, and NOT operators by clicking on them. 

If you aren’t a computer geek, 

  • OR: The rules will apply if one of many conditions is met. 
  • AND: The rules will not apply if any conditions are unmet. 
  • NOT: The rules will apply if the condition isn’t met.

To add conditions, you’ll have to click on + Add Field button.

Add New Field for Conditions and Logics - Restrict Content

We’ve listed the conditions below so you may know what conditions you can control. 

Available Conditions for Content Rules - Restrict Partial Content

You may also add sub-groups inside a Group. To do so, click on + Add Group.

Next, go to Target Contents

Target Content Tab - Content Rules

Here, you can choose the parts of the website that you want to restrict. 

Click on the + Add Field button. You may select from here. 

Target Available in Target Contents

You can target specific post types, taxonomies, posts, pages, and even the whole site.

Other options allow you to select multiple sub-options except for the whole site.

Moving to the Action tab, you can decide what the plugin should do.

Action Tab in Content Rules - Restrict Partial Content

You can choose whether you give access or restrict the selected roles from the targeted content.

Access Control in Actions Tab - Restrict Content

You can also select the action for users with restricted access to this setting. Here’s the list: 

Action in Action Tab - Restrict WordPress Page

You may choose only one of the listed actions.


Restrict Content in WordPress

When it comes to restricting content in WordPress, the challenge is ensuring access to the right content, whether it’s pages, posts, or entire website.

Luckily enough, we have multiple solutions to address these needs. Follow the one you require for your website.

Restrict WordPress Site to Non Registered Users

We’ll restrict the whole site to non-registered users.

For that, create a new Content Rule. For this, go to User Registration >> Content Rules.

Then, click on the Add New button.

Add New Content Rule - Content Restriction

You’ll be sent to the Conditions & Logics page.

Conditions and Logics - Content Restriction

Here, create a new field by clicking on + Add Field and select Roles.

Selecting Roles for Restriction

Here, select the roles you wish to provide or restrict access to. Since we’re limiting access to non-registered users, we’ll select all the roles for now and only give them access. 

Conditions and Logics for Restricting Page - Restrict WordPress Site

Then, go to Target Contents

Target Content Tab - Content Rules

Click on the + Add Field and select Whole Website

Target Contents for Whole Site

Move to Action tab. 

Action Tab in Content Rules - Restrict Partial Content

Select Access to access the selected roles on the Access Control field. Since we selected all the roles, non-registered users can’t access your site. 

You may select the appropriate action you want to set for them when they access your website. 

But wait! How will users access the registration or log-in forms if I restrict the entire site? How will they gain access?

For this, you can either select Show Message, or Show UR Form action.

Show Message will help you display a message and forms to fill out.

Show UR Form will only display a single form without any message.

If you want logged-out and non-registered users to be able to log in or register simultaneously, we recommend you choose Show Message.

For this, click on Action field and select Show Message.

Action in Action Tab - Restrict WordPress Page

After typing out your message, click on the Add Registration Form button.

Adding a Message from Action Tab - Restrict WordPress Page

A popup will appear where you can select the form you want to display.

Selecting the Form for Display Message - Restrict WordPress Site

Select your registration form.

To display your log in form, you’ll need to add the form’s shortcode.

Go to User Registration >> All Forms.

User Registration to All Forms

Go to the Login Forms tab. You’ll find this shortcode for the login form on the right side.

Log in Form Shortcode

Copy it and paste it into the text field.

Pasting Login Form Shortcode

Here’s a preview of it.

Preview for Whole Site Restriction

Restrict WordPress Page/Post to Non-Registered Users

Now, let’s learn how to restrict WordPress page. Go to Content Rules

Create a new rule with a unique name and access control. 

On Conditions & Logics, create a new field by clicking on + Add Field and choose Roles.

Selecting Roles for Restriction

Select the roles you want to give access to or restrict from. 

Let’s select every role to restrict non-registered users from accessing our page/post.

Conditions and Logics for Restricting Page - Restrict WordPress Site

Then, on the Target Contents tab, click on + Add Field. You may select from either Pick Pages or Pick Posts.

Target Available in Target Contents

We’ll now select Pick Pages and click on the empty field to select a random page. 

Selecting a Page for Restriction

You can add multiple pages/posts by selecting them.

On the Action tab, select Access Control to choose whether you provide access or limit access to the selected roles. For now, we’ll choose Access.

Access Control in Actions Tab - Restrict Content

Let’s redirect users to the Registration page to get a role and access your content.

From the Action field, select Redirect from the + Add Field.

Redirect Action for Restriction

Then, enter the URL of your Registration page.

Redirection URL for Restriction

Save your progress, and you’re done. 

You may also restrict a specific page/post directly from your page/post builder. 

Go to your content below, and you’ll find this setting. 

Restrict Content from Page and Post Builder

Here, you can choose whom to provide access for the page/post you’ve opened.  

If you select all the roles, no one can view the content. However, if no roles are chosen, everyone can view the content, regardless of the user role. 


Restrict Section Within a Page/Post (Partial Content)

You can restrict specific parts of content with two different methods.

You can either use a simple shortcode of [urcr_restrict]…[/urcr_restrict] or a Content Restriction block. 

First, we’ll show you how to restrict partial content using the shortcode.

Go to any page via Pages >> All Pages.

Open the page. At the beginning of the content, place [urcr_restrict], and at the end, place [/urcr_restrict].

You can easily control who can access our brief documentation, but you are restricted.

Here’s how to add the code to your content as a demonstration. It’ll disable access to all logged-out users only.

Using Shortcode for Restricting Access

And here’s the preview. 

Preview Using Shortcode for Restricting Content

Now, let’s try using the Content Restriction block.

Go to any page/post you want to apply the restriction.

We’ll go to a page via Pages >> All Pages.

Open the page and insert a Content Restriction block.

Click on this “+” icon and search for “Content Restriction”.

Searching for Content Restriction Block

Select it and add the content you want to restrict inside it.

Adding Content Inside the Content Restriction Block

Then, select the block and go to its Settings. You can select the role from here and choose whether selected roles can access your content.

Content Restriction Block Settings

After you’ve decided, make the changes and save your progress.

These are the two ways you can restrict WordPress page/post.


Show Content to Paid Users (Members Only)

So, you have a website where you wish to restrict access to your paid content?

We’ve got a solution for that.

You can assign user roles conditionally with User Registration while users fill out the form.

We’ll use this to restrict paid content to non registered users or, much better, specific registered users.

To assign user roles conditionally, we request you refer to this documentation.

We’ve created a Payment Registration form where users can purchase roles directly by filling out your form.

Payment Registration Form - Restrict Paid Content

Now, go to User Registration >> Content Rules and click the Add New button to create a new one.

Add New Content Rule - Content Restriction

The first page you’ll be displayed is the Conditions & Logics page.

Conditions and Logics - Content Restriction

We’ll provide access only to the paid Contributor role. You’re free to select as many roles as you want. If you select all the roles, non-registered users will not have access to the content.

To do that, click on + Add Field and select Roles.

Selecting Roles for Restriction

Choose Contributor from the Roles field.

Selecting Contributor Role for Restriction

Then, add another field by clicking the + Add Field button and select User Registration Source.

User Registration Source for Restriction

On the Registration Source field, choose the registration form from which users must purchase the role.

Selecting User Registration Source for Restriction

Add another field by clicking the + Add Field button and select Payment Status.

Payment Status for Restriction

Select Completed from the Payment Status field.

Selecting Payment Status to Restrict Paid Content

Finally, select the AND operator from this section.

Selecting AND Operation for Paid Content

Now, go to Target Contents tab.

Target Content Tab - Content Rules

Click on + Add Field button and select either Posts or Pages that you want to restrict access.

Pick Page for Restriction - Restrict WordPress Page

For now, we’ll proceed with Pages. On the Pick Pages field, select your page/pages.

Selecting Paid Content for Restriction

Then, go to the Action tab.

Action Tab in Content Rules - Restrict Partial Content

Select Access from Access Control.

Providing Access Via Access Control

On the Action field, let’s display a message letting the users know they require a Contributor role to access this content.

Display Message to Restrict Paid Content

That’s all. Press the Create Rule button at the bottom of the page to activate it.


Advanced Content Restriction with Conditions and Rules 

Let’s create a more advanced content rule. From this, you’ll be able grant access to a specific page only for users with a designated role who registered through a specific source and used a particular email domain during registration.

This allows you to finely control access based on role, source, and email criteria, ensuring only the right users gain entry to the content.

To do so, we’ll create a new Content Rule by going to User Registration >> Content Rules and clicking the Add New button.

Add New Content Rule - Content Restriction

On the Conditions & Logics tab, we’ll need to create three fields.

Conditions and Logics - Content Restriction

To do so, we click on the + Add Field

First, we’ll create a condition where the user has to have the Author role. 

For this, select Roles.  

Selecting Roles for Restriction

On the field, select Author

Selecting Author Role for Access

Let’s add another field by pressing the + Add Field

We want users who have registered via Gmail to access this content. 

Click on Email Domain

Selecting Email Domains for Restriction

We’ll type “gmail.com” into the field. 

Entering Email Domain for Access

Next, we’ll create another field and select User Registration Source

Selecting User Registration Source for Access

We’ll select this Registration Form

Selecting User Registration Source

Click on this AND operator to allow users to view your content only if all the above conditions are met. 

Selecting AND Operation for Conditions

Move on to the Target Contents tab. 

Target Content Tab - Content Rules

We want to apply the restriction on a page and a post here. 

Click on + Add Field and select Post Types

Selecting Post Types for Restriction

This will allow us to select all types of Posts, Pages, and Media.

For now, we’ll select all Posts. 

Selecting All Posts for Restriction

Then, move to the Action tab. 

Action Tab in Content Rules - Restrict Partial Content

Here, select Access in the Access Control field. 

Providing Access Via Access Control

Select the action you want to perform on restricted users in the Action field. 

Show Message Action for Restriction

For now, let’s stick with the default message. 

Press on the Create Rule button, and it’s activated.

Creating Rule and Activating It

Conclusion

Restricting content on your website is essential to maintain control over who can access your valuable resources.

With the methods we mentioned above, you can tailor access to fit your specific needs.

If you’re still confused or have queries, please inform us on our Facebook Community, X.


Frequently Asked Questions

Can I restrict content to specific geographic regions or IP addresses?

Unfortunately not. The User Registration plugin doesn’t allow that yet.

Can I restrict content based on the period after the user registered?

Yes, you can. You can set specific days for content access both during and after registration. Additionally, you can define a date range to restrict or grant access based on users’ registration, offering flexible control over user permissions.

Can two or more content rules be valid at the same time?

Yes, they can. You can set multiple content rules and activate them simultaneously.

Can I restrict or provide access based on users’ data on the form?

Certainly! In the Conditions & Logic section, create a field named ‘UR Forms.’ You can select a specific field from your form to establish your conditions. The user will gain access if you choose ‘Access’ in the Action tab and the condition is met. Conversely, if you select ‘Restrict,’ access will be denied.

How to Restrict Content in WordPress to Non Registered Users? (5 Ways)
Scroll to top

Pin It on Pinterest