Members logoWhen using the Members plugin (by MemberPress), you may run into disappearing posts or no results at all after using facets.

This issue is caused by the Members plugin filtering out protected posts from WP_Query, if accessed through the WP REST API. FacetWP uses the WP REST API to retrieve posts with AJAX, when filtering.

To fix the issue for logged-in users only, make sure to pass user authentication data through REST API requests. With this fix applied, you can keep the below-mentioned settings enabled.

To fix this issue for all users (logged-in and logged-out), go to Members > Settings and make sure the “Hide Protected Posts from WP REST API” setting is disabled. Or disable the “Enable Permissions” setting, which also disables the “Hide Protected Posts from WP REST API” setting:

Members - Disable the 'Hide Protected Posts from WP REST API' or the 'Enable Permissions' setting  to fix disappearing posts after facet filtering, for logged-in and logged-out users.
Disable the “Hide Protected Posts from WP REST API” or the “Enable Permissions” setting to fix disappearing posts after facet filtering, for logged-in and logged-out users.

Instead of disabling the above settings, you can also unhook their function programmatically, only when the WP REST API is used by FacetWP for filtering:

How to use custom PHP code?

PHP code can be added to your (child) theme's functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info

add_action( 'wp_loaded', function() { if ( function_exists( 'FWP' ) && true === FWP()->request->is_refresh ) { remove_filter('posts_results', 'members_filter_protected_posts_for_rest', 10); } });

There is another setting that can be involved, under “Private Site”: “Require authentication for access to the REST API”, which blocks the WP REST API entirely to logged-out users (independent of whether posts are protected or not). This block will cause a 401 error in the browser console on refresh (when filtering) for logged-out users only, leading to non-functioning facets. To fix this, disable the Require authentication for access to the REST API” setting:

Members - Disable the 'Require authentication for access to the REST API' setting to fix non-functional facets for logged-out users.
Disable the “Require authentication for access to the REST API” setting to fix non-functional facets for logged-out users.

Instead of disabling the above setting, you can also unhook its function programmatically, only when the WP REST API is used by FacetWP for filtering:

How to use custom PHP code?

PHP code can be added to your (child) theme's functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info

add_action( 'wp_loaded', function() { if ( function_exists( 'FWP' ) && true === FWP()->request->is_refresh ) { remove_filter('rest_authentication_errors', 'members_private_rest_api', 95); } });

Note that if you are using Members together with the MemberPress plugin, you need to make sure to also apply the fixes for similar issues caused by MemberPress.

See also

Last updated: April 3, 2025