T2 Query alternatives
The T2 Query block was deprecated in version 8.18.0 because there are better alternatives available that don't require the care and maintenance of an extensive custom block. Some of those alternatives are described here.
The WordPress Query Loop block
The WordPress Query Loop block is great for displaying query results as documented here:
- WordPress Query Loop block documentation.
- WordPress Query Loop block on GitHub.
- Query Loop patterns.
Unfortunately, the WordPress Query Loop block does not provide a user interface for filtering or searching posts.
For this, we need to combine the WordPress Query Loop block with another plugin, block or component. If you need post type filters, you may consider using Advanced Query Loop instead of the core Query Loop block.
Two of many possible filtering options are
FacetWP
FacetWP is a stable, clean and popular premium plugin that provides flexible ways to filter WordPress query results.
Using the FacetWP blocks add-on, it integrates nicely with the WordPress Query Loop block, allowing you to add user controls for filtering and searching.
Since FacetWP is a premium plugin, you need to purchase it and log in to your FacetWP account to download the plugin files. At Dekode, we can also install FacetWP with composer.
composer require dekode/facetwp
composer require dekode/facetwp-blocks
Example
Here is a simple demo of a WordPress Query Loop + FacetWP combination as well as the code for a WordPress template.
You see the FacetWP filters (called facets) on the left side of the page ("Role" and "Topic"), and the WordPress Query Loop block on the right side ("Adoption", "Attester", etc. are post titles).
In this specific case, the filters are based on taxonomy terms and displayed as checkboxes, but there are lots of other filtering and ui options to choose from.

WordPress template code examples
Facets column
The easiest way to add FacetWP filters to a WordPress template is to use shortcodes. Each facet (filter) has its own shortcode, which you can find in the WordPress admin under Settings > FacetWP.
<!-- wp:column -->
<div class="wp-block-column">
<!-- wp:t2/accordion -->
<!-- wp:t2/accordion-item {"title":"Role","level":3,"defaultOpen":true} -->
<!-- wp:shortcode -->[facetwp facet="guide_roles"]<!-- /wp:shortcode -->
<!-- /wp:t2/accordion-item -->
<!-- wp:t2/accordion-item {"title":"Topic","defaultOpen":true} -->
<!-- wp:shortcode -->[facetwp facet="guide_topics"]<!-- /wp:shortcode -->
<!-- /wp:t2/accordion-item -->
<!-- /wp:t2/accordion -->
</div>
<!-- /wp:column -->

Query Loop column
In the WordPress Query Loop block, you enable FacetWP integration by setting the enableFacetWP
attribute to true
like this <!-- wp:query {"enableFacetWP":true} -->
The core/post-template
part of the Query Loop block is repeated for each post in the query results. In this example, we just display the post title and a link to the post.
<!-- wp:column -->
<div class="wp-block-column">
<!-- wp:query {"align":"wide","query":{"inherit":true},"enableFacetWP":true} -->
<div class="wp-block-query">
<!-- wp:post-template {"className":"guide-post-template"} -->
<!-- wp:t2/post-link -->
<!-- wp:t2/icon {"icon":"arrowForward"} /-->
<!-- wp:t2/post-title {"level":3} /-->
<!-- /wp:t2/post-link -->
<!-- /wp:post-template -->
<!-- wp:query-pagination -->
<!-- wp:query-pagination-previous /-->
<!-- wp:query-pagination-numbers /-->
<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination -->
<!-- wp:query-no-results -->
<!-- wp:paragraph -->
<p>No posts were found.</p>
<!-- /wp:paragraph -->
<!-- /wp:query-no-results -->
</div>
<!-- /wp:query -->
</div>
<!-- /wp:column -->
Query Loop Filters
Query Loop Filters is a free plugin that provides a user interface for filtering and searching posts in the WordPress Query Loop block. It's created and maintained by HumanMade and is an alternative to FacetWP.