→ How to Disable Facet Auto-Refresh

FacetWP automatically refreshes the content (and facets) whenever any interaction happens. With FacetWP 1.4.2, it’s now possible to disable automatic refresh if needed.

1. Add the following code:

This code goes into your (child) theme’s functions.php¬†or into a custom plugin.

function fwp_disable_auto_refresh() {
?>
<script>
(function($) {
    $(function() {
        FWP.auto_refresh = false;
    });
})(jQuery);
</script>
<?php
}
add_action( 'wp_head', 'fwp_disable_auto_refresh', 100 );

2. Add an “Apply” button to your page:

<button onclick="FWP.refresh()">Apply</button>

You can style the “Apply” button however you wish. The important part is that the FWP.refresh() method is triggered on click.