How Does CMB2 Help WordPress Developers?

How Does the CMB2 Plugin Help WordPress Developers?

Have you heard about the WordPress plugin that seems to do nothing, but is installed on over 100,000 sites?

CMB2 is one of the most popular plugins in WordPress. We feature CMB2 heavily in the new class, “How to Develop WordPress Plugins“.

However, you would never realize how important CMB2 just by installing it from When you install CMB2, it is invisible – your site will not change in any way.

CMB2 is short for “Custom Metaboxes”, but that name probably doesn’t help if you’re new to WordPress development.

All-in-all, I think it’s time for some explanations …

What is a metabox?

If you’re not sure what a metabox is, log into a WordPress site and create a post. You’ll see metaboxes everywhere. Examples of metaboxes include “Publish”, “Tags”, “Featured Image”, “Categories” and “Format”,


Many plugins will add their own metaboxes. In fact, creating metaboxes is an essential task for many, if not most WordPress plugins … this is how plugins collect and store your data.

For example, the PublishPress Authors is built directly on top of CMB2 and uses it to build fields for the author profile.

These metaboxes are what CMB2 helps you to create. CMB2 is a developer’s toolkit for building metaboxes for WordPress. These metaboxes can be added to posts, terms, users, comments, or can be used to create custom option pages.

How to install CMB2 for your plugin

If you want to build a plugin that relies on CMB2, you can install the plugin from However, there are some problems with that approach, and you’ll see those explained in this video take from the How to Develop WordPress Plugins class. Instead, we recommend that you add the CMB2 folder to your /includes/ folder. Download the PublishPress Authors files to see how the CMB2 files are located.

This second video continues after the installation and show you how to create your first metabox with fields:

Who’s behind CMB2?

CMB2 was initially developed by WebDevStudios, a large WordPress agency. However, last month WebDevStudios joined two more agencies, Human Made, Zao, to collaborate on CMB2. The project now has it’s own Github organization.

The launch post for the new CMB2 collaboration is worth a read. Not only does it give a lot of background on the project, but it also has a ton of useful links, including these:

CMB2 is not just a plugin, but so much more. There’s the CMB2 snippet library, as well as several CMB related custom field repos. You can do so much with CMB2

Getting started with CMB2

If you want to use CMB2, we obviously recommend the plugin development videos, but here are some more links to get you started:

Here are some more plugins built with CMB2 (thanks to Justin Sternberg for the suggestions):


  • Steve Burge

    Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.

0 0 votes
Article Rating
Notify of

1 Comment
Newest Most Voted
Inline Feedbacks
View all comments
6 years ago

HI, can you please give an example of how to use cmb2 to create a custom plugin’s settings page.

Would love your thoughts, please comment.x