Skip Navigation

[Resolved] Hide posts with specific term

This thread is resolved. Here is a description of the problem and solution.

Problem:
The customer wants to restrict access to posts with the term "Market News" so that only logged-in users belonging to specific Post Groups can view them.

Solution:
Toolset Access does not restrict access based on taxonomy terms assigned to posts. Instead, it uses Post Groups to manage access, where posts are manually assigned to Post Groups in the WordPress admin area, and access is controlled for entire user roles or individual users.

To achieve the desired functionality, you can consider using Toolset's conditional HTML to restrict content based on taxonomy. Here are some resources and suggestions:

https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
https://toolset.com/forums/topic/how-to-limit-display-of-posts-to-users-within-the-current-access-group/#post-467760
https://toolset.com/forums/topic/related-posts-function/#post-1537829

While Toolset does not provide a built-in way to filter by taxonomy terms directly, combining the above methods with some custom code can achieve the desired result. However, support for custom code is beyond the scope of this forum. If custom implementation becomes a roadblock, consider seeking assistance from Toolset Contractors: https://toolset.com/contractors/

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 1 reply, has 2 voices.

Last updated by Mateus Getulio 4 weeks, 1 day ago.

Assisted by: Mateus Getulio.

Author
Posts
#2700576

Ian

Is it possible to restrict access to posts with specific term to only be visible to a Post Group.

I have posts with the term "Market News" and I want it to only be visible to logged in users that belong to either of two post groups.

Is that possible?

#2700792

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi Ian,

Access does not restrict based on taxonomy terms assigned to posts. Instead, it uses Post Groups to manage access. Posts are assigned to Post Groups manually in wp-admin, and access is controlled for entire User roles or individual Users. More details on Post Groups and Access can be found here:

https://toolset.com/documentation/user-guides/limiting-read-access-specific-content/
https://toolset.com/documentation/user-guides/access-control-texts-inside-page-content/
Setting access control

Toolset also offers conditional HTML, which can restrict content access based on taxonomy. Learn more about conditional HTML here: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/ .

While there's no built-in way for you to filter it, you might be able to achieve it with some custom code.

I checked in and I found a similar implementation for what you need in the following replies:

Restrict the content based on the role and post group:

https://toolset.com/forums/topic/how-to-limit-display-of-posts-to-users-within-the-current-access-group/#post-467760
https://toolset.com/forums/topic/how-to-limit-display-of-posts-to-users-within-the-current-access-group/#post-468093

Filter by term or group of terms:

https://toolset.com/forums/topic/related-posts-function/#post-1537829

You can try to combine both implementation to create a query that will filter the posts of a specific term and limited based on the post group of the current user.

Please have in mind that giving support to custom code is out of the scope of this forum. The hints I shared could point you in the right direction, but we can't create, debug or modify custom code for you and it's your responsibility to maintain it.

If implementation becomes a roadblock, you might want to explore the list of Toolset Contractors for assistance: https://toolset.com/contractors/

Kind regards,
Mateus

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.