In the post editor or page editor, even the admin dashboard, there are different meta boxes available. Perhaps, some of them are unused and you want to remove them to make your working screen clearer. It helps you to concentrate on the main contents better. Let’s learn how to remove unwanted meta boxes in WordPress.

You can use code or plugin as follows.

Method 1: Use Code to Remove Unwanted Meta Boxes in WordPress

WordPress has the remove_meta_box function for doing this. Here is its structure:

remove_meta_box( string $id, string|array|WP_Screen $screen, string $context )

You can read more about the parameters of this function for more details here.

For example, in the post editor section, there is a default meta box named Custom Fields.

There is a default meta box named Custom Fields.

I will add the below code to the function.php file to remove this meta box:

add_action( 'admin_menu', function() {
    remove_meta_box( 'postcustom', 'post', 'normal' );
} );

Then, it'll be no longer there:

Insert code in the function.php file to remove the meta box.

Another example, there are many different meta boxes to display general website information or shortcuts in the admin dashboard:

Different meta boxes to display general website information or shortcuts in the Admin Dashboard

I will try removing them with the below code:

add_action( 'wp_dashboard_setup', function() {
    remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
    remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
} );

Then, the Dashboard becomes tidier.

Result of removing meta boxes from the Dashboard.

Method 2: Use a Plugin to Remove Unwanted Meta Boxes in WordPress

There are many plugins for removing meta boxes. I've tried some of them and find Adminimize to be a good choice.

The Adminimize plugin is free and available on wordpress.org.

After installing the plugin, go to Settings > Adminimize. In this section, you will see that it provides many features, not only removing meta boxes.

After installing the plugin, go to Settings > Adminimize.

Go to Write options - Post section to deactivate the meta boxes from the post editor in Post. If you want to remove the meta box in other post types, choose Write options - [post type].

This plugin allows you only to deactivate meta boxes, not completely delete them as using code

As you can see, this plugin allows you only to deactivate meta boxes, not completely delete them as the using code method. But the special feature of this plugin is that you can deactivate each type of meta box for different user roles. Thus, you can restrict users to view meta boxes to prevent them from changing information.

Last Words

If you want to remove meta boxes completely so that no one can find them, using code is the better choice. If you want to authorize each user role to view just some kinds of them, using a plugin is perfect. Both of them are simple and quick.

One more thing, using plugin Adminimize also helps you customize the appearance of others in the admin bar, backend options, plugin settings,... You should dig into it to take more advantage of it.

On the contrary, in case you want to create new meta boxes for extra information for posts, pages, users, settings page, you may want to refer to these articles on how to create meta boxes without plugin, or how to do the same work with the Meta Box plugin.

Leave a Reply

Your email address will not be published. Required fields are marked *