Limit access to contexts – mixed conditions
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
- In the Posts condition group, click on the “– Select content type –“ dropdown and select Tags
- Click on the input field saying “All Tags / Tag Archives” and select the tags you want. You can search in the field by typing.
- That’s it! All posts with the selected tags can now be visited only by members of this Access Level.
Restrict Posts by Authors
- In the Posts condition group, click on the “– Select content type –“ dropdown and select Authors
- Click on the input field saying “All Authors” and select the authors you want. You can search in the field by typing.
- 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)
- In the Posts condition group, click on the “– Select content type –“ dropdown and select Dates
- 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.
- 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.