PHPackages                             alleyinteractive/internal-flags - 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. alleyinteractive/internal-flags

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

alleyinteractive/internal-flags
===============================

Use a hidden taxonomy to improve expensive queries.

v0.2.0(3y ago)5265.0k↑14.3%[2 PRs](https://github.com/alleyinteractive/internal-flags/pulls)GPL-2.0-or-laterPHPCI passing

Since Jul 27Pushed 1y ago30 watchersCompare

[ Source](https://github.com/alleyinteractive/internal-flags)[ Packagist](https://packagist.org/packages/alleyinteractive/internal-flags)[ RSS](/packages/alleyinteractive-internal-flags/feed)WikiDiscussions develop Synced 1mo ago

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

Internal Flags
==============

[](#internal-flags)

[![Testing Suite](https://github.com/alleyinteractive/internal-flags/actions/workflows/unit-test.yml/badge.svg)](https://github.com/alleyinteractive/internal-flags/actions/workflows/unit-test.yml)

Creates a hidden taxonomy to improve expensive query performance by not relying on meta queries. Allows for 'flags' to be set/unset on posts easily and entirely hidden from the end-user.

Instructions
------------

[](#instructions)

By default, the internal taxonomy will be added to all registered post types.

Common Use Cases
----------------

[](#common-use-cases)

- Hiding from archives/searches
- Posts by an author (where author is stored as a meta normally)
- Showing/hiding sponsored posts

Usage
-----

[](#usage)

### Setting a flag on a post

[](#setting-a-flag-on-a-post)

```
use Internal_Flags\set_flag;
set_flag( 'hide-from-archives', $post_id );
```

### Removing a flag on a post

[](#removing-a-flag-on-a-post)

```
use Internal_Flags\remove_flag;
remove_flag( 'hide-from-archives', $post_id );
```

### Checking if a flag is on a post

[](#checking-if-a-flag-is-on-a-post)

```
use Internal_Flags\has_flag;
has_flag( 'hide-from-archives', $post_id ); // bool
```

### Searching for posts with a flag

[](#searching-for-posts-with-a-flag)

```
use Internal_Flags\get_flag_tax_query;
$posts = new \WP_Query(
	[
		// ...
		'tax_query' => [
			get_flag_tax_query( 'show-on-page' )
		],
	],
);
```

### Searching for posts without a flag

[](#searching-for-posts-without-a-flag)

*Inverse of the above*

```
use Internal_Flags\get_flag_tax_query;
$posts = new \WP_Query(
	[
		// ...
		'tax_query' => [
			get_flag_tax_query( 'hide-from-archives', false )
		],
	],
);
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 87% 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

Unknown

Total

1

Last Release

1392d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/338d27065b1074f2d66d049d742f22996dd137eef6f91bc8f75350ceee1e8ef2?d=identicon)[srtfisher](/maintainers/srtfisher)

---

Top Contributors

[![srtfisher](https://avatars.githubusercontent.com/u/346399?v=4)](https://github.com/srtfisher "srtfisher (20 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

wordpresswordpress-plugin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alleyinteractive-internal-flags/health.svg)

```
[![Health](https://phpackages.com/badges/alleyinteractive-internal-flags/health.svg)](https://phpackages.com/packages/alleyinteractive-internal-flags)
```

PHPackages © 2026

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