# Disable query auto detection in FacetWP

**URL:** <https://community.mainwp.com/t/disable-query-auto-detection-in-facetwp/7992>\
**Category:** Code Snippets\
**Tags:** wordpress\
**Created:** [December 5, 2023, 8:16pm UTC](https://community.mainwp.com/t/disable-query-auto-detection-in-facetwp/7992 "2023-12-05T20:16:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastian-moran](https://community.mainwp.com/user_avatar/community.mainwp.com/sebastian-moran/32/16_2.png) [@sebastian-moran](https://community.mainwp.com/u/sebastian-moran)\
**Post date:** [December 5, 2023, 8:16pm UTC](https://community.mainwp.com/t/disable-query-auto-detection-in-facetwp/7992/1 "2023-12-05T20:16:07Z")

</div>

Disable query auto detection in FacetWP.

**Snippet Type**

`Execute on Child Sites`

**Snippet**

```auto
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) {
  if ( true !== $query->get( 'facetwp', false ) ) {
    $is_main_query = false;
  }
  return $is_main_query;
}, 10, 2 );

```

---

<div class="post-metadata">

**Author:** ![system](https://community.mainwp.com/uploads/default/original/2X/4/4cfc87ac67e4ebdbfa0bbf0b19c8657f35a29a5b.png) [@system](https://community.mainwp.com/u/system)\
**Post date:** [January 4, 2024, 8:16pm UTC](https://community.mainwp.com/t/disable-query-auto-detection-in-facetwp/7992/2 "2024-01-04T20:16:34Z")

</div>

Closed on January 4, 2024, 8:16pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
