You will encounter various meta boxes in the post editor, page editor, and admin dashboard. If some of these are unused, it’s time to hide them and enhance your workspace clarity.
Simplifying your interface will allow you to concentrate fully on your main content.
In the WordPress post editor, you will encounter sections that deliver essential information about your post, such as the Publish box, Format box, and Categories box. These sections are designated as “meta boxes,” which contain crucial metadata related to the post.
Remember, the term “meta box” specifically refers to these sections and does not pertain to our plugin.
Let’s dive into the process of removing unnecessary meta boxes in WordPress through code or plugin as follows.
Use Code to Hide Meta Boxes in WordPress
WordPress offers the remove_meta_box function specifically for this purpose.
remove_meta_box( string $id, string|array|WP_Screen $screen, string $context )
Its structure is essential when addressing the post editor section, particularly where the default meta box, Custom Fields, is located.
I will implement the following code in the functions.php file to effectively eliminate this meta box:
add_action( ‘admin_menu’, function() {
remove_meta_box( ‘postcustom’, ‘post’, ‘normal’ );
} );
After that, you can see it will hide
Discover the diverse range of meta boxes that enhance your admin dashboard by showcasing essential website information and convenient shortcuts.
You can try hiding them by using 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’ );
} );
After implementation, you can see that the Dashboard becomes tidy.
Use Plugin to Hide Meta Boxes in WordPress
There are numerous plugins designed to remove meta boxes, but after testing several options, I can confidently say that Adminimize is the best choice.
After installing the plugin, head straight to Settings >> Adminimize. This section is packed with features, allowing you to not only remove meta boxes but also customize your experience extensively.
To disable the meta boxes in the Post editor, go to Write options – Post section. If you wish to remove the meta box for other post types, select Write options – [post type].
This plugin effectively allows you to deactivate meta boxes without the need for complete deletion, unlike the code method. A standout feature is its capability to deactivate specific types of meta boxes for different user roles. This ensures that you can restrict users from viewing certain meta boxes, thereby preventing them from modifying important information.
Bottom Line
If you want to completely hide meta boxes in WordPress so that no one can see them, using code is the best approach.
To authorize specific user roles to view certain meta boxes, a plugin is the ideal solution. Both methods are straightforward and effective.
Additionally, the Adminimize plugin allows you to customize the appearance of elements in the admin bar, backend options, and plugin settings. Take the time to explore it and maximize its benefits.
Leave a Reply