We have seen some users having issues with FacetWP, with Pressable as hosting provider.

These issues are caused by Pressable’s memcached object caching, which appears to be impossible to disable. Object caching is (in most cases) problematic in combination with FacetWP. It interferes with FacetWP’s ability to detect or use the right query on refresh. This leads to a range of possible issues like post listings not refreshing or filtering, facets not loading, unexpected posts showing, pagination issues, wrong post and/or result counts, or the “FacetWP was unable to auto-detect the post listing” error.

Normally, the advice would be to disable object caching entirely, but in this case this seems impossible. The only solution we have found so far is the following code, which needs to be added to your (child) theme’s functions.php. The code flushes the cache on each page load of the facet page. Note that this clears the whole site cache, not just the facet page. This is not optimal, but the only thing that is currently known to work:

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

// Solution for Pressable hosting // Replace "the/uri" with the URI of the page: the part of the URL without the domain name and the query variables, without beginning and ending slashes. add_action( 'facetwp_init', function(){ if ( 'the/uri' == FWP()->helper->get_uri() ) { wp_cache_flush(); } });

If you are aware of other solutions, or ways to turn off object caching with Pressable, please let us know.

See also

Last updated: October 28, 2024