Restricting View Content to be Members-Only

Restricting your Views can be helpful if you run a membership site and you want to restrict content to registered users. There are a couple of different ways to protect your Views by login status or user role.

1. By Using a Membership Plugin

The WordPress Members plugin by MemberPress allows you to restrict access to content on your website. It’s effective, powerful, and best of all, free.

To get started, log in to your WordPress site, hover over Plugins in the left-hand menu and click on Add New. Next, search for “Members - Membership & User Role” and install the plugin.

the Members plugin showing 674 reviews and 200000 active installations

Wrap the [gravityview] embed shortcode in the [members] shortcode to restrict access to logged-in users. 

[members_logged_in]
	[gravityview id='47']
[/members_logged_in]

You can also restrict your view based on user role:

[members_access role="subscriber"] 
	[gravityview id='47'] 
[/members_access]

2. By Password-Protecting Your Page

WordPress gives you the ability to password protect pages, posts, and Views.

To password protect your View (or a page where your View is embedded), click on the Edit link next to Visibility. Next, check “Password protected” and enter your chosen password.

The WordPress publish metabox with 'password protected' checked

You can also restrict access to your View by making it “Private”. If you select this option only Administrators and Editors will be able to see your View and its content.

3. By Hiding Certain Fields in Your View

GravityView gives you the ability to restrict access to certain fields based on login status or user role. This is a great option if you want some information in your View to be public and other information to be private. 

To do this, edit your View and click the gear icon next to the field you want to restrict. This will bring up the Field Settings window. Under Visibility, check the box that says “Make visible only to logged-in users?”. 

The GravityView Field Settings box showing the 'make visible only to logged-in users checkbox

To restrict visibility to specific user roles, select a role from the dropdown menu below. The different options are:

  • Any Logged-In User
  • Author or Higher
  • Can View gravity Forms Entries
  • Editor or higher
  • Can Edit Gravity Forms Entries
  • Administrator

If you want to modify the visible roles, you can follow these instructions.

4. By Redirecting Logged-Out Users

Using the Redirection plugin you can redirect users based on login status or user role.

After activating the plugin, create a new redirect rule for your View page. Next, click on the gear icon to bring up additional options. Here you can configure redirects based on login status or user role.

the Redirection settings with an arrow pointing to a dropdown that says 'URL and login status'

For a full video course on using the Redirection plugin to protect Views in GravityView, check out our free course on Gravity Guide.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.