Taxonomy Terms Counter

Taxonomy Terms Counter

Details
View on WordPress

Taxonomy Terms Counter adds term counts to taxonomy panels in the Gutenberg editor sidebar.
You can enable or disable counts per taxonomy and post type from the plugin settings page.

Source Code

Full source code is available on GitHub:
https://github.com/secretlab48/taxonomy-terms-counter

Notes:
– The settings page lists only HIERARCHICAL taxonomies. Non-HIERARCHICAL taxonomies (for example, post_tag) are not supported.
– The plugin works only on admin post screens that use the Gutenberg editor.
– The plugin does not work with the Classic Editor.
– If an existing post type is missing on the settings page, it likely has show_in_rest set to false.
– If a taxonomy is missing for a post type, it likely has show_in_rest set to false.

Hooks

The plugin provides the following hooks for customization:

PHP Filters

  • ttcounter_term_count_taxonomies — Filter taxonomies list for term counts. Args: $taxonomies, $post_type, $request.
  • ttcounter_term_count_get_terms_args — Filter get_terms() args. Args: $args, $taxonomy, $post_type.
  • ttcounter_term_count_value — Filter count value per term. Args: $count, $term, $taxonomy, $post_type.
  • ttcounter_term_counts_response — Filter REST response. Args: $results, $post_type, $taxonomies.
  • ttcounter_sanitized_settings — Filter sanitized settings before save. Args: $sanitized_taxs, $request.

PHP Actions

  • ttcounter_settings_updated — Fires after settings are saved. Args: $sanitized_taxs, $request.

JS Filters

  • ttcounter.termCountTaxonomies — Filter taxonomy list before REST request. Args: taxonomies, postType.
  • ttcounter.termCountData — Filter REST response data before rendering. Args: data, postType.
  • ttcounter.restrictedPostTypes — Filter restricted post types list in settings. Args: restrictedPostTypes.
  • ttcounter.restrictedTaxonomies — Filter restricted taxonomies list in settings. Args: restrictedTaxonomies.
  • ttcounter.termCountLabel — Filter sidebar label text. Args: value, { name, count, label }.

JS Actions

  • ttcounter.sidebarUpdated — Fires after sidebar counts update. Args: termsByTax.

Details

Plugin code:
taxonomy-terms-counter
Plugin version:
1.0.0
Outdated:
No
WP version:
6.8 or higher
PHP version:
7.4 or higher
Test up to WP version:
6.9.1
Total installations:
0
Last updated:
2026-02-22
Rating:
Times rated:
0
gutenberg
single-post-admin-page
taxonomy-terms-counter