WordPress Meta Boxes, Taxonomy Settings and Options Pages

This plugin allows you to create meta boxes for posts, settings for taxonomy terms and custom option pages without affecting your website performance. Gutenberg sidebars are supported too!

The Fastest Metabox Plugin

You know, I'm not just saying that. One of my subscribers provide me the performance test result he made. You can find it here

Default input fields - text, checkbox, textarea, select, radio buttons for WordPress Pages.

Taxonomies Support

In WordPress 4.4 the wp_termmeta table was intruduced. It means that now we can easily create additional settings for each taxonomy term.

Add image uploader field in tags

Option Pages Support

Create new settings pages or add options to the existing ones, like «General», «Writing», «Reading» etc.

Add settings fields to the General Settings page

No GUI

This plugin is for creating user interfaces, but it doesn't mean that it should have its own UI - one of the reasons why the plugin is so fast. Basic PHP knowledge required.

$metabox = array(
	// ID of the metabox and custom field name prefix
	'id'	=>	'test1',
 
	// Only users with this capability can see and use the metabox
	'capability' =>	'edit_posts',
 
 	// Title of the metabox DIV
	'name'	=>	'Default input fields',
 
	// Custom post types names
	'post_type'	=>	array('post', 'page'),
 
	// array of fields, in this example it is only text field
	'args'	=>	array( 
		array(
			'id'	=> 'textexample',
			'label' => 'Text',
			'description' => 'Text field description, <code>HTML</code> tags are supported',
			'type'	=> 'text', // "text", "checkbox", "textarea", "radio" etc etc
			'placeholder' 	=> 'Placeholder'
		)
	)
);
 
// just pass options here and that's all - metabox is created
if ( class_exists( 'trueMetaBox' ) ) new trueMetaBox( $metabox );

Support

I'm always here if you need my help.
Please create a ticket if you need assistance with my plugins or contact me if you have a question.

Default input fields - text, checkbox, textarea, select, radio buttons for WordPress Pages.

Speed Up the Websites and Save lots of your Time

Just for 29$

Get the plugin

About me and Why I decided to Create this Plugin

I’m a developer.

On almost every website I working with, I use custom settings pages or settings for posts (custom fields). And my main priorities every time are to make WordPress admin area a very friendly place for users and to make a website lightning fast.

I do not like the default «Custom Fields» metabox because it is very unclear for any user (it was unclear for me as well). And it becomes the bigger problem when you need to emulate checkbox, selects, image uploaders.

I do not like ready metabox plugins because: 1) most of them create a custom post type just for the plugin settings! It’s horrible. 2) developers of such plugins tried to do everything as beautiful as it can be even if it makes the WordPress dashboard twice slower.

So, for a very long time I coded metaboxes and option pages by myself in functions.php (or so). But then I understood that I spend so much time to code the metaboxes every time and the idea appeared to create a plugin to simplify and speed up the process.

1. Metaboxes for Posts, Pages, Custom Post Types

How to create a metabox?

$metabox = array(
	// ... 
	// metabox parameters here, name => value
	// ...
	'args' => array( // array of fields
 
		array(
			// ... 
			// field parameters here, name => value
			// ...
		),
		array(
			// ... 
			// field parameters here, name => value
			// ...
		)
		// ... more fields here
	)
 
);
// create a metabox from our parameters
new trueMetaBox( $metabox );

Now let’s create a very simple metabox for pages with a text field and a checkbox.

$metabox = array(
 
	 // ID of the metabox and custom field name prefix
	'id' =>	'my',
 
	// Only users with this capability can see the metabox
	'capability' => 'edit_posts', 
 
	 // metabox title
 	'name' => 'Misha\'s test metabox with input text and checkbox',
 
	// custom post types names, you can use array( 'page', 'post', 'your_type' )
	'post_type' => array('page'),
 
	// metabox position: low | high | default
	'priority' => 'high',
 
	// array of all metabox input field and their params
	'args' => array(
 
		/* simple text input */
		array(
			'id'	=> 'textexample',
			'label' => 'Text',
			'description' => 'Text field description, <code>HTML</code> tags are supported',
			'type'	=> 'text',
			'placeholder' 	=> 'It is a placeholder...'
		),
 
		/* checkbox input */
		array(
			'id'	=> 'checkboxexample',
			'label' => 'Checkbox',
			'description' => 'Checkbox label, <code>HTML</code> tags are supported',
			'type'	=> 'checkbox',
			'capability' => 'manage_options', // so only admin can see this field
			'default' => 'on' // checkbox marked checked as default
		)
	)
 
);
 
new trueMetaBox( $metabox );

You can insert the code to your theme functions.php (if you do not know where).

Metabox with a text input and with a checkbox creating with the help of my plugin less than in 1 minute.
As you can see, the checkbox is checked by default :)
type example supports
text
input type text field for metabox
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'type'	=> 'text',
	'capability' => '',
	'placeholder' => '',
	'default'  => ''
),
checkbox
input type checkbox field example
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'capability' => '',
	'type'	=> 'checkbox',
	'default'  => '' // on
),
select
option select field example
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'capability' => '',
	'type'	=> 'select',
	'args'  => array(
		'Name' => 'Value',
		'Name 2' => 'Value 2'
	),
	'default' => ''
),
multiselect
Select2 based multiselect fields.
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'capability' => '',
	'type'	=> 'multiselect',
	'args'  => array(
		'Dombay'=>'dombay',
		'Elbrus'=>'elbrus',
		'Roza Khutor'=>'roza-hutor'
	),
	'default' => array( 'dombay' )
),
radio
radio button for WordPress meta boxes
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'capability' => '',
	'type'	=> 'radio',
	'args' => array(
		'Radio button 1'=>'Value 1',
		'Radio button 2'=>'Value 2'
	),
	'default' => 'Value 1'
),
textarea
Example of textarea usage for WP metabox
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'capability' => '',
	'type'	=> 'textarea',
	'placeholder' => ''
	'default' => ''
),
color
Color Picker field in WordPress for our metabox
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'capability' => '',
	'type'	=> 'color',
	'default' => '' // #0099cc
),
editor
TinyMCE and HTML (quicktags) editor for your metabox and option page.
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'capability' => '',
	'type'	=> 'editor',
	'editor_args' => array(),
	'default' => ''
),

editor_args are the parameters, supported by the third argument of wp_editor() WordPress function.

image
Upload Image for your posts, terms of option pages.
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'capability' => '',
	'type'	=> 'image',
	'default' => 1110 // attachment ID
),

The image uploader functionality is similar to WordPress default Featured Images for posts. Click on the button to open a media gallery, or click the image if the image is already set. If you’re interested to know how to use this uploader for your own code, this tutorial will be helpful for you.

file
Upload files for WordPress metaboxes and option pages.
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'capability' => '',
	'type'	=> 'file',
	'default' => ''
),
video
Input text with video preview.
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'capability' => '',
	'type'	=> 'video',
	'default' => ''
),
map
Google Maps for your metabox or for your options pages with Locate me button.
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'capability' => '',
	'type'	=> 'map',
	'default' => '' // address
	'default_lat' => '-25.363',
	'default_lng' => '131.044',
),
getposts
Select posts in metabox
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'placeholder' => '',
	'type'	=> 'getposts',
	'multiple' => true, // default: false
	'post_type' => array( 'post', 'page' )
)

Now it is so easy to create your own related posts block or even something more cool.

getterms
Select terms of multiple taxonomies in the same metabox field.
array(
	'id'	=> '',
	'label' => '',
	'description' => '',
	'placeholder' => '',
	'type'	=> 'getterms',
	'multiple' => true, // default: false
	'taxonomy' => 'post_tag'
)

taxonomy parameter supports array values as well, defaults to category.

type example supports

2. Example: Add Images to Taxonomy Terms

Creating settings for a specific taxonomy terms is as simple as create a metabox. Just use another class name and change a couple parameters in it.

$taxonomy = array(
 
	// ID is the part of term metadata
	// for posts you maybe know get_post_meta() function, for terms it is get_term_meta()
	// get_term_meta( $term_id, 'test5_imageexample', true ) )
	'id' => 'test5',
 
	// this settings is available only for users with this capability
	'capability' => 'edit_posts',
 
	// you can specify more than one taxonomy, for example array( 'category', 'post_tag', 'product_cat' )
	'taxonomy' => array('post_tag'),
 
	// fields are below
	'args' => array(
 
		// field 1
		array(
			// it is also the part of term meta key
			'id' => 'imageexample',
			'label'	 => 'Country flag',
			'description' => 'description',
			'type' => 'image' // all types and their params are described in the table above.
		)
	)
 
);
 
if( class_exists( 'trueTaxonomyMetaBox' ) ) // you can check if my plugin is active but it is not necessary
	new trueTaxonomyMetaBox( $taxonomy );

The result:

Adding the custom image uploader field to your tags taxonomy. The code is above this image.
So, on the screenshot above I decided to use default post tags to separate posts by countries without creating a custom taxonony. Now it is possible to add images to terms (tags).

All the metabox data will be stored in term meta. When you need to get a value of the field, just use get_term_meta() function. Here is an example for our taxonomy image:

$image_id = get_term_meta( $term_id, 'test5_imageexample', true );

3. Custom Option Pages with my plugin

Creating New Option Pages

Yes, yes, I know that it is better to add style customization into Appearance > Customizer, but this is just an example.

$options = array(
	// yes, slug is the part of the option name, so, to get the value, use
	// get_option( '{SLUG}_{ID}' ); 
	// get_option( 'styles_headercolor' ); 
	'slug'	=>	'styles',
 
	// h2 title on your settings page
	'title' => 'Customize your website appearance here',
 
	// this displayed in admin menu, try to make it short
	'menuname' => 'Design',
 
	'capability'=>	'manage_options',
 
	// WordPress option pages consist of sections, so, 
	// at first we create an array of sections and add fields in each section
	'sections' => array(
 
		// first section
		array(
 
			// section ID isn't used anywhere, but it is required
			'id' => 'headerfsfsfsdf',
 
			// section name is displayed as h2 heading
			'name' => 'Header options',
 
			// and only now the array of fields
			'fields' => array(
				array(
					'id'			=> 'headercolor',
					'label'			=> 'Header Color',
					'type'			=> 'color', // table of types is above
					'default'		=> '#333'
				),
				array(
					'id'	=> 'headerfixed',
					'label' => 'Fixed Header',
					'description' => 'Make the header fixed on the all pages of your website.',
					'type'	=> 'checkbox'
				)
			)
		),
 
		// second section
		array(
			'id' => 'advanceddfsdfsdf',
			'name' => 'Advanced Customizations',
			'fields' => array(
				array(
					'id'	=> 'social',
					'label' => 'Show Share Buttons',
					'type'	=> 'checkbox',
					'default' => 'on'
				),
 
				// yes, I know that WordPress has its own beautiful custom CSS option :)
				array(
					'id'	=> 'custom_css',
					'label' => 'Custom CSS',
					'type'	=> 'textarea'
				)
			)
		)
	)
);
 
if( class_exists( 'trueOptionspage' ) )
	new trueOptionspage( $options );

So, if I add the above code to the functions.php file (for example) while my plugin is active, that’s what will appear in admin area:

Example of the settings page, created with my plugin in less than 10 minutes.

Add More Settings to WordPress Default Option Pages

Below is an example of how to add new fields in General Settings in WordPress dashboard.

$generaloptions = array(
 
	// general, writing, reading, discussion, media, permalink
	'slug' => 'general',
	'sections' => array(
		array(
 
			// you can create a new section if you specify your custom ID ( not "default" ) and name parameter
			// if you use id "default" and don't specify a name, the fields will be added just after the default ones
			'id' => 'default',
 
			'fields' => array(
 
				array(
					'id'	=> 'phone',
					'label' => 'Phone',
					'type'	=> 'text'
				),
 
				array(
					'id' => 'mapexample',
					'label' => 'Office Location',
					'type' => 'map'
				)
			) 
		) 
	)
);
 
if( class_exists( 'trueOptionspage' ) )
	new trueOptionspage( $generaloptions );
You can easily add any options to WordPress default settings pages.

4. Gutenberg Sidebar Settings

Since version 3.0 my plugin allows you to create settings panels for a brand new WordPress editor – Gutenberg:

Gutenberg sidebar settings

Read the documentation here.

Compare the Performance of My Plugin with the Most Popular Metabox Plugins

My blog reader compared my plugin (True Metabox) with popular Advanced Custom Fields and Toolset Types and sent me the result table (click to enlarge).

Compare my plugin speed with the other similar plugins.

Do you agree that it is much better to use my True Metabox plugin for good website performance?

For collecting this data he used the following piece of code.

function wp_usage(){
	printf( ('SQL: %d за %s сек. '), get_num_queries(), timer_stop(0, 3) );
	if ( function_exists('memory_get_usage') )
		echo round( memory_get_usage()/1024/1024, 2 ) . ' MB ';
}
add_filter('admin_footer_text', 'wp_usage');

Changelog

3.0.1 – Sep 1, 2019

3.0 – May 24, 2019

2.3 – August 20, 2017

2.1 – May 16, 2017

2.0 – May 8, 2017

1.1 – June 9, 2016

1.0

14 Day Money Back Guarantee

Secure Checkout. Instant Download

Recommended

Developer

$129 one-time payment
  • Lifetime priority support
  • Lifetime updates
  • Unlimited websites

Personal

$29 one-time payment
  • 2 weeks/support
  • 1 year/updates
  • 1 website

View my refund policy here

The plugin is a one-time purchase which includes a license for plugin updates and support. To continue receiving updates & support after your license has expired you may renew.