How To Add a Restriction Rule

Updated on February 29, 2024

What’s in This Guide

This guide covers how to choose what content to protect in your Global Restriction. Adding a Restriction Rule is the third of the 3 main steps for creating a Global Restriction.

Content Control Restriction Steps Graphic 3

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 our How To Add a Restriction to a Block guide.

What content is protected?

You can tell Content Control what content to protect by adding rules. If you don’t add any rules, Content Control does not restrict any content on your site by default.

You can even make a sequence of rules and string them along using AND and OR conditions (more on that later). If that’s not enough, you can make nested sequences of rules by adding groups of conditions.

Let’s start with adding 1 rule. We’ll use the homepage as an example. I.e., you’ll get to see the homepage if your global restriction allows you.

1. Create or edit a global restriction and click Content

Cc V2 Global Restrictions Content Tab 2 1024W

If you need to learn how to create a global restriction, visit our A Quick Start to Your First Global Restriction doc.

2. Click Add Rule

Cc V2 Global Restrictions Add Rule 584W

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

Cc V2 Global Restrictions Add Rule Home Page 952W

4. Click Content Is The Home Page, then click Save Restriction

Save Restriction Button Highlighted

Do you need more than 1 rule?

What if you want to restrict your homepage and sample page (as an example)? This means only the roles you allow can view the homepage or the sample page.

Add as many rules as you need!

No problem! You can add another rule.

You must join your rules with an “OR” or an “AND” condition. Let’s cover using ORs first.

You can even add groups of conditions to handle more complex or nested conditions.

Using ORs

Remember that rule you added earlier to protect the homepage? Let’s also add an “OR” rule to protect the sample page.

Follow these steps.

1. Below your homepage rule, click Add Rule

Make sure you have the OR setting between the first rule and this new rule.

Cc V2 Global Restrictions Add Rule 2 554W

2. Search for “selected page” and click Content Is A Selected Page

Cc V2 Global Restrictions Selected Page 510W

4 Search for “sample” and click Sample Page

Cc V2 Global Restrictions Sample Page 502W

5 Click Save Restriction

Cc V2 Global Restrictions Save 3 577W

Here’s a demo of those steps.

Cc V2 Global Restrictions Add Or Rule 846W

After you hit Save Restriction, only people allowed to see the homepage or sample page can view that content.

The opposite is true. Anyone not allowed to see the homepage or the sample page cannot view that content.

Heads up!

It’s important to notice we don’t want to use AND here. If we used AND, this restriction would never fire (never take effect). That’s because the homepage and sample page are different pages in our case. Since they are 2 different pages, you can bring up only one OR the other.

Let’s cover using ANDs next.

Using ANDs

In this example, you’ll want to create a new global restriction or edit a restriction, but “trash” all Content Rules first. In our scenario, we want to allow reviewers to review our draft post. We’ll need 3 things.

  1. A Drafts category
  2. A review tag
  3. A post that has both the Drafts category and review tag

After you add another rule, you can change the default OR to an AND. Look below for how that’s done.

Let’s get to it!

Follow these steps.

1. Click Add Rule to add your first rule

Cc V2 Global Restrictions Add Rule 584W

2. Search for Content Is A Post with Category

Cc V2 And Example Post With Category 1024W

Pick the category you want. In our example, we chose Drafts.

Cc V2 And Example Drafts Category Marked 992W

3. Under your first rule, click Add Rule

Cc V2 And Example Add Rule 2 946W

Make sure you’re joining your first rule with the second rule using an AND condition.

4. Search for Content Is A Post with Tag

Cc V2 And Example Post With Tag 776W

Pick the tag you want. In our example, we chose review.

Cc V2 And Example Review Tag 1024W

You should have something like this now.

Cc V2 Restriction And Rule 1024W

5. Click Save Restriction

Cc V2 And Example Save 1024W

Done! Now, your restriction protects any post in the Draft category with a review tag. Congrats!

Pro tip: To clone a restriction, you can first export the restriction you want to copy. Then, import it back in. Follow the steps in our How to Export and Import Global Restrictions guide.

Is this article helpful? What are your feelings