Filtering by user role

If you want to display only entries created by users with a specific role, you can do that with the Advanced Filters extension

Note: This functionality requires GravityView 2.0.14. Filtering by role may not work correctly in earlier versions.

When editing a View, scroll to the Settings Panel and click the "Filter & Sort" tab:

Screenshot of the Settings Panel highlighting the Filter & Sort tab

Click the "Add Condition" button

Add Condition button in Filter & Sort View Setting

Then choose "Created By User Role" from the first dropdown

Select 'Created By User Role' from the form field dropdown

Choose the role you wish to display entries from

A drop-down showing all the roles for the site (Administrator, Subscriber, etc)

If you choose "Any Role of Current User", the currently logged-in user's roles will be used

Filter configured with 'Any Role of Current User' selected
All of the user's roles will be used to filter the entries: If a user is logged in and the user has the roles of "Subscriber" as well as "Customer", then the filter will show entries from users who are Subscribers OR Customers. If the current user is an Editor and an Administrator, then entries will be shown from all Editors and Administrators.

You can also use "is not"!

You can exclude entries created by users with specific roles by selecting the "is not" comparison from the filter dropdown.

To show all entries that were not created by site administrators, you could add this configuration: "Created By User Role" "is not" "Administrator", as shown below.

Filter configured to hide all entries created by administrators by setting the filter value to 'Created By User Role' 'is not' 'Administrator'
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us