A Quick Start to Your First Global Restriction

Updated on February 28, 2024

When you create a global restriction, you need to answer 3 questions.

  1. Who can see your content?
  2. How is your content protected?
  3. What content is protected?

Each question corresponds to a step for creating a restriction.

What’s in This Guide

In this quick start guide, you’ll create the most basic global restriction for your site’s default Sample Page. For this basic restriction:

  • You’ll let only logged-in visitors see the Sample Page.
  • You’ll redirect anyone not logged in to your site’s login page.
  • After logging in, they’ll automatically return to the Sample Page.

Did you see how we answered all 3 questions before we even started? Don’t worry if you didn’t. We’re going to answer them in a second.

Are you looking to protect a block instead of using a Global Restriction?
If you want to protect a block in the WordPress block editor, head over to A Quick Start to Your First Block Restriction.

Getting Started

First, from the side menu in your wp-admin area, go to Settings > Content Control.

Click Add Restriction to get things started.

Create Your First Global Restriction

1. Set up who can see your content

Your very first global restriction will let only logged-in visitors see your content.

In the General tab, enter a name for your restriction.

Keep everything else the same.

  • Add description…: blank
  • Who can see this content?: Logged In Users
  • User Role: Any

Your restriction must have a name. Otherwise, you’ll get an error when you click Add Restriction.

2. Choose how to protect your content

Let’s protect your content by redirecting people to the login page. Then, they’ll get redirected back to the original post/page they were trying to see.

Click the Protection tab.

For the Protection settings, keep everything the same.

  • How do you want to protect your content?: Redirect
  • Where will the user be taken?: Login & Back
  • Handling matches within archives: Filter the restricted items’ title, excerpt, and content.
  • Handling matches everywhere else: Filter the restricted items’ title, excerpt, and content.

3. Select what content to protect

Lastly, you’re going to protect the default Sample Page on your site.

Click the Content tab.

Click Add Rule.

In the Search for a rule field, type “page”.

Scroll through the dropdown menu and click Content Is A Selected Page.

Click inside the Select page(s) field and click Sample Page in the dropdown.

Heads Up!
You need to have at least 1 rule to enable your restriction. You can still save restrictions without any rules and add them later. But if try to enable your restriction with the Content settings blank (no rules and no groups), you’ll get an error message.

Having at least 1 rule is good ๐Ÿ˜Œ

Having no rules is sad ๐Ÿ˜”

If you haven’t yet, click Disabled to turn on your new restriction.

The Disabled toggle turns into Enabled when your restriction is on.

Click Add Restriction to save everything.

Are you ready to add a group of rules? Head over to our How To Add a Restriction Group guide to learn how.

Before You Go

Notice that the only things you “touched” in this process were:

  • The restriction name
  • The content rule section

So now, you’ll have to log in as any role to view the Sample Page on your site.

If you’re logged out and go to the Sample Page, you’ll get redirected to the login page. Once you log in, you’ll automatically go back to the Sample Page. This time, you’ll see the content.

Take it for a spin ๐Ÿ˜Œ

Pro tip: Always make sure to clear all caches on the browser, WordPress, server, and CDN before testing any changes.

Are you ready to level up?

Check out these guides to learn more about setting different user roles, protection methods, and content restriction rules.

Is this article helpful? What are your feelings