CMB2 icon
Forms

CMB2

CMB2 is a metabox, custom fields, and forms library for WordPress that will blow your mind.

  • By Justin Sternberg
  • v2.13.5
  • Updated

Overview

CMB2 describes itself as: “CMB2 is a metabox, custom fields, and forms library for WordPress that will blow your mind.”

It is active on 300,000+ WordPress sites and rated 5.0 out of 5 by 91 users on WordPress.org. Developers can extend it through 23 actions and 61 filters, listed below.

We haven't published a hands-on review of CMB2 yet. Want one, or need help with it? Send us a request.

How to install CMB2

  1. Open the plugin installer. In your WordPress dashboard go to Plugins → Add New Plugin.
  2. Search for it. Type “CMB2” and pick the one by Justin Sternberg.
  3. Install and activate. Click Install Now, then Activate.
Install with a zip file or WP-CLI

Download the zip from the WordPress.org plugin page, then go to Plugins → Add New Plugin → Upload Plugin, choose the file and click Install Now. Or from the command line:

wp plugin install cmb2 --activate

Requirements: WordPress 3.8.0+ · PHP 7.4+ · tested up to WordPress 7.1.4

Hooks & customisation

CMB2 2.13.5 fires 23 actions and 61 filters. Use them from your child theme or a snippets plugin to change how it behaves without editing its files.

cmb2 — top hooks
// Whether to align options-page box REST reads with WordPress core's settings/op…
apply_filters( 'cmb2_rest_enforce_options_page_read_permissions', false, $cmb );

// Allows overloading the object (CMB2 or CMB2_Field) with additional capabilitie…
apply_filters_ref_array( "{$object_class}_inherit_{$method}", $args );

// Filter attributes for a field type. The dynamic portion of the hook name, $ele…
apply_filters( "cmb2_{$element}_attributes", $args, $type_defaults, $this->field, $this->types );

// Filter for determining if a field value has a valid image file-type extension.
apply_filters( "cmb2_{$field_id}_is_valid_img_ext", $is_valid, $file, $file_ext );

// Fires before fields have been processed/saved.
do_action( "cmb2_{$object_type}_process_fields_{$this->cmb_id}", $this, $this->object_id() );

// Fires on the admin side when CMB2 is included/loaded.
do_action( 'cmb2_admin_init' );

Browse all 84 hooks with examples →

Need CMB2 customised?

Tell us what you want changed, added or fixed and we'll reply with an estimate.

WP EXPERTS is independent and not affiliated with Justin Sternberg. Plugin names and logos belong to their owners. Version, rating and install figures from WordPress.org, checked Nov 17, 2026.

Alternatives in Forms

See all →

Just another contact form plugin. Simple but flexible.

10+ million installs 121 hooks
WPForms icon

WPForms

14K

The best WordPress contact form plugin. Drag & Drop form builder to create beautiful contact forms, payment forms, & other…

5+ million installs 809 hooks

Get a fast contact form plugin. Create advanced forms using drag and drop form builder with all smart features.

800,000+ installs Reviewed 985 hooks

Best WordPress form builder plugin. Create contact forms, payment forms & order forms with 1000+ integrations.

600,000+ installs Reviewed 1067 hooks