Bundling Meta Box
You can use Meta Box and its extensions as standalone plugins. You can also bundle them in your themes or plugins.
Licensing
The rules are different for free and premium extensions. Free extensions are Meta Box, Meta Box Lite, and the free extensions on WordPress.org. Premium extensions are the extensions that you buy on metabox.io.
| Where you bundle | Free extensions | Premium extensions |
|---|---|---|
| Websites for you or your clients | Allowed | Allowed with your license |
| Free products, such as plugins and themes on WordPress.org | Allowed | Not allowed |
| Products and services that you sell to other people, such as premium plugins, themes, SaaS, hosting, and site maintenance | Allowed | Contact us for a custom pricing plan |
Using TGM Plugin Activation
Use this method for Meta Box and free extensions. Your theme or plugin declares them as dependencies. WordPress then installs them as normal plugins and updates them automatically.

- Download TGM Plugin Activation. For I'm going to use TGMPA in a:, select Plugin.
- Extract the
.zipfile. - Copy the files
class-tgm-plugin-activation.phpandexample.phpto your theme or plugin folder. - Open the
example.phpfile and add Meta Box to the list of required plugins:
require_once __DIR__ . '/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'prefix_register_required_plugins' );
function prefix_register_required_plugins() {
$plugins = [
[
'name' => 'Meta Box',
'slug' => 'meta-box',
'required' => true,
],
];
$config = [
'id' => 'your-id',
];
tgmpa( $plugins, $config );
}
- Include the
example.phpfile in thefunctions.phpfile of your theme or in the main file of your plugin.
Using Composer
Use this method to put Meta Box and extensions in the vendor folder of your theme or plugin. This example bundles Meta Box in a plugin.
- In your plugin folder, create a
composer.jsonfile with this content:
{
"require": {
"wpmetabox/meta-box": "^5"
},
"autoload": {
"files": [
"vendor/wpmetabox/meta-box/meta-box.php"
]
}
}
- In your plugin folder, run
composer install. - Add this line to the main file of your plugin:
require 'vendor/autoload.php';
For more extensions, add them to the require and autoload lists. To install premium extensions, you must use your license key. Read the Composer documentation for the full steps.
Directly including extensions
With this method, extensions do not update automatically. You must update them manually. Old versions can cause conflicts with new versions of WordPress, or with other plugins that use a different version of Meta Box. Use this method only if you cannot use the methods above.
- Copy the extension folder to your theme or plugin. You can put it in the root folder or in a subfolder.
- Include the main file of the extension in the
functions.phpfile of your theme or in the main file of your plugin:
require get_template_directory() . '/mb-settings-page/mb-settings-page.php';