PHPackages                             tfrommen/meta-taxonomy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tfrommen/meta-taxonomy

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

tfrommen/meta-taxonomy
======================

This plugin registers a taxonomy that provides a high-performance means to query posts in a somewhat meta-based way.

v1.3.0(10y ago)09GPL-3.0PHPPHP &gt;=5.3.0

Since Sep 19Pushed 10y ago1 watchersCompare

[ Source](https://github.com/tfrommen/meta-taxonomy)[ Packagist](https://packagist.org/packages/tfrommen/meta-taxonomy)[ Docs](https://github.com/tfrommen/meta-taxonomy)[ RSS](/packages/tfrommen-meta-taxonomy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (3)Used By (0)

Meta Taxonomy
=============

[](#meta-taxonomy)

[![Latest Stable Version](https://camo.githubusercontent.com/1c482cb85f0442dc8e38e7fe9c1858b1033ef318187b635314f43d80b6c198a9/68747470733a2f2f706f7365722e707567782e6f72672f7466726f6d6d656e2f6d6574612d7461786f6e6f6d792f762f737461626c65)](https://packagist.org/packages/tfrommen/meta-taxonomy)[![Project Status](https://camo.githubusercontent.com/5b5a2250da48f45495a817a4bcdabb5d101fff298acebe00a55a52815b7119ed/687474703a2f2f6f70656e736f757263652e626f782e636f6d2f6261646765732f6163746976652e737667)](http://opensource.box.com/badges)[![Build Status](https://camo.githubusercontent.com/48704e3fc4297ba37ae6fe4966008a8e8aa3ebb4e6745d228c30775f5b505379/68747470733a2f2f7472617669732d63692e6f72672f7466726f6d6d656e2f6d6574612d7461786f6e6f6d792e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/tfrommen/meta-taxonomy)[![License](https://camo.githubusercontent.com/854305931ca7859698b30c61e59d1dbf97e8e03b6fa08d993eebf3b86edf6adb/68747470733a2f2f706f7365722e707567782e6f72672f7466726f6d6d656e2f6d6574612d7461786f6e6f6d792f6c6963656e7365)](https://packagist.org/packages/tfrommen/meta-taxonomy)

Have you ever wanted to query posts based on the condition that a specific meta is set or equal to a given value, but then you heard/learnt how inefficient a (complex) meta query actually is?

This is exactly when *Meta Taxonomy* kicks in.

**Disclaimer**: This plugin is not intended to replace the post meta API in general. There are (a lot of) cases where using a post meta makes much more sense than using a term, or where using a term is simply impossible.

Installation
------------

[](#installation)

1. [Download ZIP](https://github.com/tfrommen/meta-taxonomy/archive/master.zip).
2. Upload contents to the `/wp-content/plugins` directory on your web server.
3. Activate the plugin through the *Plugins* menu in WordPress.
4. Be impressed by how fast your *meta-tax* queries can get, compared to ordinary meta queries.

Usage
-----

[](#usage)

To be honest, this plugin is no big deal. It just provides you with a one-click solution for using high-performance taxonomy-based meta-like queries. Once the plugin is activated, you can assign terms of the new meta taxonomy to your posts, and then query the posts in a highly efficient way (compared to meta queries).

### Filters

[](#filters)

In order to customize certain aspects of the plugin, it provides you with several filters. For each of these, a short description as well as a code example on how to alter the default behavior is given below. Just put the according code snippet in your theme's `functions.php` file or your *customization* plugin, or to some other appropriate place.

#### `meta_taxonomy_args`

[](#meta_taxonomy_args)

If you want to alter a specific taxonomy argument but you can't find a fitting filter, there's `meta_taxonomy_args`, which provides you with the complete args array.

```
/**
 * Filters the taxonomy args.
 *
 * @param array $args Taxonomy args.
 */
add_filter( 'meta_taxonomy_args', function( $args ) {

	// Turn the whole taxonomy UI invisible
	$args[ 'show_ui' ] = FALSE;

	return $args;
} );
```

#### `meta_taxonomy_capabilities`

[](#meta_taxonomy_capabilities)

This filter provides you with the the capabilities required for the four taxonomy-specific actions `manage_terms`, `edit_terms`, `delete_terms` and `assign_terms`.

```
/**
 * Filters the taxonomy capabilities.
 *
 * @param string[] $capabilities Taxonomy capabilities.
 */
add_filter( 'meta_taxonomy_capabilities', function( $capabilities ) {

	// Let meta taxonomy terms be deleted by admins only
	$capabilities[ 'delete_terms' ] = 'manage_options';

	return $capabilities;
} );
```

#### `meta_taxonomy_description`

[](#meta_taxonomy_description)

If you want to alter the taxonomy description, feel free to do it via this filter.

```
/**
 * Filters the taxonomy description.
 *
 * @param string $description Taxonomy description.
 */
add_filter( 'meta_taxonomy_description', function() {

	// Kill the description
	return '';
} );
```

#### `meta_taxonomy_labels`

[](#meta_taxonomy_labels)

In case you don't like the labels, easily adapt them to your liking.

```
/**
 * Filters the taxonomy labels.
 *
 * @param string[] $labels Taxonomy labels.
 */
add_filter( 'meta_taxonomy_labels', function( $labels ) {

	// A little more horror, please...
	$labels[ 'not_found' ] = 'ZOMG, no metas found!!1!!1!!oneone!!!1!eleven!1!';

	return $labels;
} );
```

#### `meta_taxonomy_name`

[](#meta_taxonomy_name)

Yes, you can also alter the taxonomy name (slug).

```
/**
 * Filters the taxonomy name.
 *
 * @param string $name Taxonomy name.
 */
add_filter( 'meta_taxonomy_name', function() {

	// Rename it
	return 'meta_term';
} );
```

#### `meta_taxonomy_object_type`

[](#meta_taxonomy_object_type)

By default, the meta taxonomy is registered for default posts (i.e., post type `post`) only. If you would like add other custom post types, do this by using this filter. You can either return a single post type slug, or an array of them.

```
/**
 * Filters the taxonomy object types.
 *
 * @param string[] $object_types Array of names of object types for the taxonomy.
 */
add_filter( 'meta_taxonomy_object_types', function( $object_types ) {

	// Add the taxonomy for pages and a CPT, too
	return array_unique( array_merge( (array) $object_types, array(
			'page',
			'my_cpt',
	) ) );
} );
```

### Functions

[](#functions)

In order to make use of a specific functionality, there may be a function already. To prevent any incompatibility, all global plugin functions are pluggable. In the rare case where you already have a function within the global namespace with a plugin function's name, you would have to set up such a function by yourself. In principle, this is just a copy of what you can find in the `functions.php` file **of this plugin**.

#### `has_meta_term`

[](#has_meta_term)

If you want to check wether a specific post has a specific meta term, you can do this by means of the plugin's `has_meta_term` function.

```
if ( has_meta_term( get_the_ID(), 'popular' ) ) {
	// Do something
}
```

Contribution
------------

[](#contribution)

If you have a feature request, or if you have developed the feature already, please feel free to use the Issues and/or Pull Requests section.

Of course, you can also provide me with translations if you would like to use the plugin in another not yet included language.

Changelog
---------

[](#changelog)

[Changelog](CHANGELOG.md)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~32 days

Total

2

Last Release

3861d ago

PHP version history (2 changes)v1.2.0PHP &gt;=5.2.4

v1.3.0PHP &gt;=5.3.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6049306?v=4)[Thorsten Frommen](/maintainers/tfrommen)[@tfrommen](https://github.com/tfrommen)

---

Top Contributors

[![tfrommen](https://avatars.githubusercontent.com/u/6049306?v=4)](https://github.com/tfrommen "tfrommen (11 commits)")

---

Tags

wordpress-pluginmetapostsposttaxonomytermtaxonomiesterms

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tfrommen-meta-taxonomy/health.svg)

```
[![Health](https://phpackages.com/badges/tfrommen-meta-taxonomy/health.svg)](https://phpackages.com/packages/tfrommen-meta-taxonomy)
```

###  Alternatives

[aliziodev/laravel-taxonomy

Laravel Taxonomy is a flexible and powerful package for managing taxonomies, categories, tags, and hierarchical structures in Laravel applications. Features nested-set support for optimal query performance on hierarchical data structures.

23318.4k](/packages/aliziodev-laravel-taxonomy)[sylius/taxonomy-bundle

Flexible categorization system for Symfony.

26388.2k7](/packages/sylius-taxonomy-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
