Search Restrictions
WooCommerce Membership Made Easy allows site administrators to add search restrictions for different user memberships. By default, WordPress site search is enabled for all users regardless of their type. You can use this feature to block certain site content from appearing in search results based on user memberships.
Also you can block certain posts/pages/custom post type items from appearing in search results.
Blocking Specific Content from Search
You can either block certain posts/pages/custom post types from searching or entire posts/pages/custom post types from searching. First, we can use Private Content Settings -> Search Settings to block specific Id’s. Following screenshot previews Search Settings section.
You can type the first few letter of post/page/custom post type title to load the list of post/pages/custom post types. Then you can select the posts/pages/custom post type to be blocked from searching. These posts/pages/custom post types added in this section will be globally blocked from all types of users regardless of their user type.
Search Restrictions by User Membership
You can use Private Content Settings -> Search Restrictions section to block different type of content for different type of user memberships in site search. Following screen previews the Search Restriction settings.
Let’s take a look at each setting.
- Guests can Search – You can add support for searching posts/pages/custom post types for users who are not logged into the site. You can choose multiple options. Post types added in this section will be searchable only for guest users without an account. So you can search all the posts from the selected types except the post/pages/custom post types blocked in Search Settings section. Guests can also search the types added for Everyone can Search setting.
- Members can Search – You can add support for searching posts/pages/custom post types for logged in users. You can choose multiple options. Post types added in this section will be searchable for members who have a account on the site and already logged into the site. So you can search all the posts from the selected types except the post/pages/custom post types blocked in Search Settings section. Members can also search the types added for Everyone can Search setting.
Then you will have a list of memberships available in your site. You can add support for searching posts/pages/custom post types for users with a specific membership level. You can choose multiple options. Post types added in this section will be searchable for members who have the specific membership on the site and already logged into the site. So you can search all the posts from the selected types except the post/pages/custom post types blocked in Search Settings