If you see this error in the browser Console, FacetWP can’t find a FacetWP-enabled listing template on the page. This usually happens when FacetWP’s auto-detection of the listing breaks, or when a page has facets but no listing at all.

Most often, the page does have a FacetWP-enabled listing, but another plugin breaks FacetWP’s auto-detection of it. There can be several reasons, but the usual culprit is HTML minification by another plugin.

HTML minification removes HTML comments. FacetWP uses the <!--fwp-loop--> HTML comment (placed by itself) to automatically add a facetwp-template class to the container element surrounding the posts in the listing. The facetwp-template class is needed to dynamically replace the HTML within this element when filtering. Without this class, FacetWP does not know which content to dynamically replace, and facets will not work. This issue can happen on all types of listing templates, except on Listing Builder listings.

Possible fixes are:

  • Disable HTML minification in any performance/optimization plugin you have installed.
  • If you are using Cloudflare, open Cloudflare’s dashboard, browse to Speed > Optimization > Content Optimization, and disable the HTML option in the “Auto Minify” settings.
  • If you don’t want to, or cannot disable HTML minification, or if HTML minification is not involved, you’ll have to add the facetwp-template class manually to the container element surrounding your listing’s post loop. In an archive or custom WP_Query, this would look like this example. In WooCommerce templates, you can also use these hooks that do the same.

If you opt to manually add the facetwp-template class to a container element, make sure that all your facets are outside of it. In WooCommerce templates that use WooCommerce pagination or a WooCommerce sort box, make sure these two elements are inside of the container element.

Filter out the “FacetWP has not detected a listing template” error

In niche scenarios it may be useful to remove the “FacetWP has not detected a listing template” error message. For example when FacetWP JavaScript assets are loaded on all pages, e.g. if included in a code compilation pipeline.

Add the following snippet to your (child) theme’s functions.php to filter the error out of the Console errors:

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_footer', function() { ?> <script> const originalConsoleError = console.error; console.error = function() { if (arguments[0] && typeof arguments[0] === 'string' && arguments[0].includes('FacetWP has not detected')) { return; } originalConsoleError.apply(console, arguments); }; </script> <?php });

See also

Last updated: March 20, 2025