PHPackages                             humanmade/clean-up-leftover-multi-meta - 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. [Database &amp; ORM](/categories/database)
4. /
5. humanmade/clean-up-leftover-multi-meta

ActiveWordpress-plugin[Database &amp; ORM](/categories/database)

humanmade/clean-up-leftover-multi-meta
======================================

Remove duplicate meta values for any single meta key with multiple meta value rows in the database.

0.1.0(3y ago)1222GPL-2.0-or-laterPHP

Since Sep 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/kadamwhite/clean-up-leftover-multi-meta)[ Packagist](https://packagist.org/packages/humanmade/clean-up-leftover-multi-meta)[ RSS](/packages/humanmade-clean-up-leftover-multi-meta/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Clean up leftover multi-meta
============================

[](#clean-up-leftover-multi-meta)

There is a potential bug in the REST API (identified by @MiguelAxcarHM, and being discussed between @TimothyBJacobs and @kadamwhite [here in WordPress core Slack](https://wordpress.slack.com/archives/C02RQC26G/p1663892062273559)) where updates to meta values can fail unexpectedly because of unrelated other meta.

Our working theory is that this happens when a meta key is registered (using `register_meta` or `register_post_meta`) with `'single' => true`, but that meta key still has multiple rows in the database as you would expect if it was previously used as `'single' => false`. For example,

```
+---------+---------+---------------------------------------------+---------------+
| meta_id | post_id | meta_key                                    | meta_value    |
+---------+---------+---------------------------------------------+---------------+
|    8898 |    5804 | process_owner                               | 333           |
|   11870 |    5804 | process_owner                               | 333           |
|   13868 |    5804 | process_owner                               | 333           |
|   15748 |    5804 | process_owner                               | 333           |
+---------+---------+---------------------------------------------+---------------+

```

This plugin provides a CLI command which can be used to iterate through all posts of a post type, check for registered meta for that post, and identify whether any `single`-registered meta keys have duplicated rows in the postmeta table. The duplicated meta IDs are then cleaned out.

If a meta key has multiple rows for a post with *different* values, we should leave those alone.

Example command:

```
wp clean-up-leftover-multi-meta --post-type=my-cpt-name --dry-run

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

1322d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a498e093283b7b42aa63d5f75851cda7ec4c4e2137cb8482e02d3181b48eafa3?d=identicon)[kadamwhite](/maintainers/kadamwhite)

---

Top Contributors

[![kadamwhite](https://avatars.githubusercontent.com/u/442115?v=4)](https://github.com/kadamwhite "kadamwhite (18 commits)")

### Embed Badge

![Health badge](/badges/humanmade-clean-up-leftover-multi-meta/health.svg)

```
[![Health](https://phpackages.com/badges/humanmade-clean-up-leftover-multi-meta/health.svg)](https://phpackages.com/packages/humanmade-clean-up-leftover-multi-meta)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M545](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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