Limit access to contexts – mixed conditions

Note: If you’re not already familiar with how to limit access to individual pages or all posts, please click here before continuing.

Restrict User Access lets you add unlimited level restrictions that you can mix and match in any way you like. Using logical AND, OR and NOT, you can restrict content that meets specific conditions, which we refer to as contexts.

 

When to use AND or OR?

A simple way of determing if an Access Condition should use logical AND or OR is by saying this:

 

Limit access only if the visited webpage is a ________ AND/OR a ________

 

Using OR – simple: Limit access only if the visited webpage is a Post OR a Page

Using AND – mixed: Limit access only if the visited webpage is a Post AND (written by) Author X.

 

In the following examples, we show how you can restrict a context by adding another condition to a level that restricts all posts. The examples can be read independently, but it is recommended to read them in order.

 

Restrict Posts with Tags

Display sidebar on posts with select tags

 

  1. In the Posts condition group, click on the “– Select content type –“ dropdown and select Tags
  2. Click on the input field saying “All Tags / Tag Archives” and select the tags you want. You can search in the field by typing.
  3. That’s it! All posts with the selected tags can now be visited only by members of this Access Level.

 

Restrict Posts by Authors

Display sidebar on posts by authors

 

  1. In the Posts condition group, click on the “– Select content type –“ dropdown and select Authors
  2. Click on the input field saying “All Authors” and select the authors you want. You can search in the field by typing.
  3. That’s it! All posts written by the selected authors can now be visited only by members of this Access Level.

 

Restrict Posts published at a select Time (Add-on)

 

  1. In the Posts condition group, click on the “– Select content type –“ dropdown and select Dates
  2. Below the input field saying “All Dates / Date Archives”, select a day, month and year and click Add. You can leave out e.g. day to target only month and year.
  3. That’s it! All posts published at the selected times can now be visited only by members of this Access Level.

 

Restrict all conditions above

As you see, it is possible to combine several conditions into a single condition group to target a very specific context. If you have followed all the examples above for the same level, the conditions will now say:

Limit access only if the visited webpage is a Post (and) with the selected Tags, (and) written by the selected Authors, and published at the selected Time.

 

 

We could keep adding conditions to this level, but you should now have a good idea how to take advantage of mixed conditions. Click here to read more about the currently supported Access Conditions.

 

Tip: Adding conditions step by step is a good way to make sure the restrictions work as expected. Restrict User Access will not identify invalid or unreachable conditions.
Was this article helpful to you?