PHPackages                             emneslab/custom-meta-box-builder - 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. emneslab/custom-meta-box-builder

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

emneslab/custom-meta-box-builder
================================

A modern WordPress meta box builder with 30+ field types, visual admin UI, nested groups, conditional logic, REST API, Gutenberg sidebar, and WP-CLI support.

v2.1.0(1mo ago)00GPL-2.0-or-laterPHPPHP &gt;=8.1CI passing

Since Apr 15Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/emnesco/custom-meta-box-builder)[ Packagist](https://packagist.org/packages/emneslab/custom-meta-box-builder)[ Docs](https://github.com/emnesco/custom-meta-box-builder)[ RSS](/packages/emneslab-custom-meta-box-builder/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Custom Meta Box Builder
=======================

[](#custom-meta-box-builder)

[![Latest Version on Packagist](https://camo.githubusercontent.com/057c34997ec254a72b69250cb29357a7665274ebeaf7876e67247f32e8eabdbc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656d6e65736c61622f637573746f6d2d6d6574612d626f782d6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/emneslab/custom-meta-box-builder)[![PHP Version](https://camo.githubusercontent.com/d4fef7e3f05b39271328620d619544ac25bfa3d97c837adf612998e2d29d8e40/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f656d6e65736c61622f637573746f6d2d6d6574612d626f782d6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/emneslab/custom-meta-box-builder)[![License](https://camo.githubusercontent.com/3aaf5c60f515f7b573cee26e16a479c12ff8837c23fa699511e4389d89bf3936/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656d6e65736c61622f637573746f6d2d6d6574612d626f782d6275696c6465722e7376673f7374796c653d666c61742d737175617265)](LICENSE)

A modern, developer-friendly WordPress meta box builder with 30+ field types, a visual admin UI, nested/repeatable groups, conditional logic, REST API, Gutenberg sidebar, WP-CLI, and more.

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

[](#installation)

```
composer require emneslab/custom-meta-box-builder
```

> **Note:** This package uses `composer/installers` with type `wordpress-plugin`. In a standard WordPress setup it installs to `wp-content/plugins/`. In [Bedrock](https://roots.io/bedrock/) it installs to `web/app/plugins/`.

Activate the plugin:

```
wp plugin activate custom-meta-box-builder
```

Requirements
------------

[](#requirements)

- PHP 8.1+
- WordPress 6.0+

Quick Start
-----------

[](#quick-start)

### Register a meta box via PHP

[](#register-a-meta-box-via-php)

```
add_custom_meta_box('cmb-book-details', 'Book Details', ['post', 'page'], [
    ['id' => 'book_title',   'type' => 'text',     'label' => 'Book Title', 'required' => true],
    ['id' => 'book_summary', 'type' => 'textarea', 'label' => 'Summary'],
    ['id' => 'book_genre',   'type' => 'select',   'label' => 'Genre', 'options' => [
        'fiction'     => 'Fiction',
        'non_fiction' => 'Non-Fiction',
        'sci_fi'     => 'Science Fiction',
    ]],
    ['id' => 'book_price', 'type' => 'number', 'label' => 'Price'],
], 'normal', 'high');
```

### Retrieve saved data

[](#retrieve-saved-data)

```
// Using the public API
$title = cmb_get_field('book_title');
cmb_the_field('book_title'); // echoes escaped value

// Or standard WordPress
$title = get_post_meta(get_the_ID(), 'book_title', true);
```

### Visual Admin Builder

[](#visual-admin-builder)

Navigate to **CMB Builder** in the WordPress admin to create field groups without code. The builder includes:

- Drag-and-drop field ordering
- Live PHP code generation
- Template code snippets (Result tab)
- Import/Export (JSON)

Features
--------

[](#features)

- **30+ field types** — text, textarea, number, select, checkbox, radio, file, image, gallery, color, date, time, range, toggle, password, post, user, taxonomy, group, flexible content, message, divider, and more
- **Repeatable fields** — any field can be made repeatable
- **Nested groups** — unlimited depth group-in-group nesting
- **Drag-and-drop** — sortable repeater rows
- **Tabs** — organize fields into tabbed sections
- **Conditional logic** — show/hide fields based on other field values (AND/OR)
- **Validation** — required, email, url, min, max, numeric, pattern rules
- **Flexible layouts** — horizontal, inline, responsive width classes (25%–100%)
- **Taxonomy meta** — add fields to category/tag edit screens
- **User profile meta** — add fields to user profile pages
- **Options pages** — create admin settings pages
- **REST API** — expose fields via `show_in_rest`
- **Gutenberg sidebar** — display fields in block editor sidebar
- **WP-CLI** — `wp cmb list`, `wp cmb get`, `wp cmb set`
- **Frontend forms** — `cmb_render_form()` / `cmb_the_form()`
- **Gutenberg blocks** — `cmb_register_block()` API
- **WPGraphQL** — auto-register fields in GraphQL schema
- **Import/Export** — JSON configurations
- **Multi-language** — per-locale field values
- **Bulk operations** — batch meta updates
- **Extensible** — create custom field types by extending `AbstractField`

Field Types
-----------

[](#field-types)

CategoryTypes**Basic**Text, Textarea, Number, Email, URL, Password, Hidden**Content**WYSIWYG**Choice**Select, Radio, Checkbox, Checkbox List, Toggle, Button Group**Date &amp; Color**Date, Time, Color**Media**File, Image, Gallery**Relational**Post, Taxonomy, User**Layout**Group, Flexible Content, Message, Divider**Special**Link, oEmbed, RangeExtending
---------

[](#extending)

Create a custom field type:

```
namespace MyPlugin\Fields;

use CMB\Core\Contracts\Abstracts\AbstractField;

class RatingField extends AbstractField {
    public function render(): void {
        $value = $this->getValue();
        printf(
            '',
            esc_attr($this->getNameAttribute()),
            esc_attr($value)
        );
    }

    public function sanitize(mixed $value): mixed {
        return max(1, min(5, (int) $value));
    }
}
```

Register it:

```
use CMB\Core\FieldFactory;

FieldFactory::registerType('rating', \MyPlugin\Fields\RatingField::class);
```

Hooks
-----

[](#hooks)

All hooks fire with the `cmbbuilder_` prefix (legacy `cmb_` prefix is deprecated):

HookTypeDescription`cmbbuilder_before_render_field`ActionBefore a field renders`cmbbuilder_after_render_field`ActionAfter a field renders`cmbbuilder_before_save_field`ActionBefore a field value is saved`cmbbuilder_after_save_field`ActionAfter a field value is saved`cmbbuilder_sanitize_{type}`FilterCustom sanitization per field type`cmbbuilder_field_config`FilterModify field config before rendering`cmbbuilder_meta_box_config`FilterModify meta box config at registration`cmbbuilder_admin_box_saved`ActionAfter an admin UI field group is savedDocumentation
-------------

[](#documentation)

See the [docs/](docs/) directory:

- [Getting Started](docs/getting-started.md)
- [Field Types](docs/field-types.md)
- [Groups &amp; Repeaters](docs/groups-and-repeaters.md)
- [Configuration Reference](docs/configuration-reference.md)
- [Hooks Reference](docs/hooks.md)
- [Extending](docs/extending.md)
- [Advanced Features](docs/advanced-features.md)
- [Testing](docs/testing.md)

Testing
-------

[](#testing)

```
composer install
composer test
```

License
-------

[](#license)

GPL-2.0-or-later. See [LICENSE](LICENSE).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance89

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

55d ago

### Community

Maintainers

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

---

Top Contributors

[![bdkabiruddin](https://avatars.githubusercontent.com/u/6913340?v=4)](https://github.com/bdkabiruddin "bdkabiruddin (93 commits)")

---

Tags

composer-packagecustom-fieldsmeta-boxphpwordpresswordpresscustom fieldsgutenbergfield-builderadmin-uimeta-boxpost metauser metataxonomy-metaacf-alternative

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/emneslab-custom-meta-box-builder/health.svg)

```
[![Health](https://phpackages.com/badges/emneslab-custom-meta-box-builder/health.svg)](https://phpackages.com/packages/emneslab-custom-meta-box-builder)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[wpmetabox/meta-box

The most powerful &amp; comprehensive plugin to create, manage, show and connect dynamic data with forms and custom fields effortlessly on WordPress.

1.2k20.7k4](/packages/wpmetabox-meta-box)[roots/wp-stage-switcher

WordPress plugin that allows you to switch between different environments from the admin bar

382458.3k3](/packages/roots-wp-stage-switcher)[vinkla/wordplate

The WordPlate boilerplate

2.2k5.3k](/packages/vinkla-wordplate)[rilwis/meta-box

The most powerful &amp; comprehensive plugin to create, manage, show and connect dynamic data with forms and custom fields effortlessly on WordPress.

1.2k1.8k1](/packages/rilwis-meta-box)

PHPackages © 2026

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