Query Posts Grouped by Taxonomy WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA
Extends the core Query Loop block with a "Group by Taxonomy" option, enabling grouped front-end output by any selected taxonomy.
Install
Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/carstingaxion/query-groupedby-taxonomy/releases/download/0.1.1/query-groupedby-taxonomy.zipExtends the core Query Loop block with a "Group by Taxonomy" option, enabling grouped front-end output by any selected taxonomy.
Description
This plugin adds a Group by Taxonomy Inspector panel to the core Query Loop block. When a taxonomy is selected, the query results are modified server-side via posts_clauses to join taxonomy tables and order by term name — enabling grouped output on the front end.
Motivation:
We needed a way to query upcoming events, unique by theater-productions. Try this plugin together with GatherPress to see, what we wanted to achieve.

Features:
- Adds a "Group by Taxonomy" panel to the core Query Loop block Inspector.
- Supports any public taxonomy associated with the selected post type.
- Uses
pre_render_blockandquery_loop_block_query_varsto inject custom query variables. - Modifies the SQL via
posts_clausesfor efficient taxonomy-based ordering and grouping. - No additional blocks required — works directly with the existing
core/queryblock and its variations. - Fully compliant with WordPress and WordPress VIP coding standards.
Installation
- Upload the plugin files to the
/wp-content/plugins/query-groupedby-taxonomydirectory. - Activate the plugin through the 'Plugins' screen in WordPress.
- In the block editor, insert a Query Loop block and open the "Group by Taxonomy" panel in the Inspector sidebar.
- Select a taxonomy to enable grouping on the front end.
Frequently Asked Questions
Does this replace the Query Loop's output?
The SQL query is modified to join taxonomy tables and order by term name. The actual rendering depends on the Query Loop's inner blocks and any additional front-end processing.
Can I use custom taxonomies?
Yes. Any publicly registered taxonomy associated with the selected post type will appear in the taxonomy selector.
Changelog
All notable changes to this project will be documented in the CHANGELOG.md.
Releases
2 releases. Each count is every asset in that release; expand a row for the breakdown.