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.
How to install CMB2
- Open the plugin installer. In your WordPress dashboard go to Plugins → Add New Plugin.
- Search for it. Type “CMB2” and pick the one by Justin Sternberg.
- 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 --activateRequirements: 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.
// 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' );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.