If you are hosting your website on WP Engine, it is possible you run into several issues with indexing, filtering and showing results. The following are known fixes for specific issues:

Disable WPE_Governor

If you experience problems with FacetWP’s indexer stalling or not indexing all your posts, or facets not functioning correctly (e.g. becoming empty after filtering), try disabling WP Engine’s “WPE_Governor” by adding the following line to wp-config.php (not to functions.php):

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

define( 'WPE_GOVERNOR', false );

WP Engine limits long queries (longer than 1024 characters) for performance reasons. The above line in wp-config.php prevents this. At the time of writing this feature is undocumented in their support site.

Add FacetWP’s API URL to WP Engine’s cache exclusions

If you have problems with new or imported posts not showing up in the results, or a “FacetWP was unable to auto-detect the post listing” error, the cause can be that WP Engine is caching FacetWP’s API URL:

/wp-json/facetwp

Reach out to WP Engine support and ask them to add the above URL to your account’s custom cache exclusion list.

Disable WP Engine’s object cache

We’ve seen several users with problems related to WP Engine’s object cache. The issue seems to be that WP Engine’s object cache is ignoring FacetWP’s query parameters in the URL and is using the same cached query regardless of query parameters being present. This causes two different issues if the query is already cached:

  • FacetWP cannot detect the query, resulting in a “FacetWP was unable to auto-detect the post listing” error, and causing facets to not load.
  • A hard reload of a page with facet selections in the URL will show the cached query instead of the query that should be modified by the FacetWP query parameters.

If you experience these issues, try disabling WP Engine’s Object Cache:

Disable WP Engine's Object Cache.
Disable WP Engine’s Object Cache.

To do so:

  1. Log in to the User Portal
  2. Select the environment name you’d like to enable object caching on
  3. Click Caching
  4. Locate Object cache and toggle to Off

It may be possible to exclude pages with facets from the object cache, or to let the object cache include query parameters in the URL. If you find a way to do this, or if WP Engine support helped you with this, please let us know.

WP Engine and Pods Alternative Cache

A performance tip: if you are hosting your website on WP Engine, and your site is using the Pods plugin, experiment with the Pods Alternative Cache add-on plugin. It was developed for and tested specifically on the WP Engine platform to improve the performance of cached objects generated from Pods (but it works on other hosting providers too). See the page about our (decommissioned) Pods add-on page for more info.

See also

Last updated: July 18, 2024