- Help Center Home
- Getting started
- Introducing FacetWP
- Installation and updates
- FAQ
- How it works
- What are facets?
- Facet types
- Built-in facet types
- Checkboxes
- Dropdown
- Radio
- fSelect
- Hierarchy
- Slider
- Search
- Autocomplete
- Date Range
- Number Range
- Star Rating
- Proximity
- Pager + load more
- Sort
- Reset
- User Selections
- Add-on facet types
- Map
- Hierarchy Select
- Range List
- Time Since
- A-Z Listing
- Color
- Custom facet types
- Custom facet types
- Indexing
- Listing templates
- Extras & integrations
- Add-on features and extras
- Using FacetWP with …
- Built-in integrations
- Advanced Custom Fields
- WooCommerce
- SearchWP
- WP-CLI
- Add-on integrations
- Blocks
- Bricks
- Elementor
- Beaver Builder
- WP Recipe Maker and Tasty Recipes
- Relevanssi
- WPML and Polylang
- Meta Box
- Flatsome (theme)
- External integrations
- Breakdance
- Document Library Pro
- Listify (theme)
- Listable (theme)
- WPGraphQL
- Tips & tricks
- WordPress multi-site
- WP All Import
- WebToffee Import Export
- WP Job Manager
- Easy Digital Downloads
- EDD Reviews
- Intuitive Custom Post Order
- Custom Taxonomy Order
- Post Types Order
- Genesis framework
- WP External Links
- ElasticPress
- Yoast SEO
- All in One SEO (Pro)
- The Events Calendar Pro
- Google Analytics 4
- Image Optimization by Optimole
- Meow Lightbox
- Cookiebot
- Caching, hosting & security
- Object caching
- WP Rocket
- Cloudflare
- WP Engine
- Pressable
- New Relic
- WordPress REST API Authentication
- All-In-One Security (AIOS)
- Fast Velocity Minify
- Incompatibilities
- Incompatible plugins and themes
- Troubleshooting
- Troubleshooting guide
- Using the right query
- Common issues
- Common indexing issues
- Get support
- Developers
- Hooks reference
- Indexing hooks
- Querying hooks
- Output hooks
- facetwp_facet_display_value
- facetwp_facet_html
- facetwp_facet_render_args
- facetwp_facet_pager_link
- facetwp_facet_sort_options
- facetwp_template_html
- facetwp_shortcode_html
- facetwp_render_params
- facetwp_render_output
- facetwp_builder_item_value
- facetwp_builder_dynamic_tags
- facetwp_builder_dynamic_tag_value
- Advanced hooks
- Deprecated hooks
- JavaScript reference
- Shortcodes reference
- FacetWP REST API
- How FacetWP works
- The FacetWP URL
- FacetWP speed and limits
- Tutorials
- Code snippets
- Feedback
- What’s new
- Changelog
- News & announcements
Why am I seeing “FacetWP has not detected a listing template” in the Console?
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.
See also
- Listing templates
- What are facets?
- Using the Listing Builder
- Using FacetWP with Cloudflare
- Using FacetWP with WooCommerce
- Using a WP archive page
- Using a custom WP_Query
- Why am I seeing “FacetWP was unable to auto-detect the post listing”?
Last updated: July 31, 2024