How to Hide WordPress Meta Boxes in the Post Editor

Hide Metaboxes

A WordPress website always starts by looking very clean. But after you choose a theme and install a lot of plugin, the user interface quickly becomes very crowded.

In other guides, we've shown you how to hide WordPress admin menus, hide the admin toolbar, and hide dashboard widgets. In this tutorial, we'll explain how to hide the “meta boxes” that appear below your WordPress posts and in the sidebar, when you're editing a post.

In the image below, you can see some typical meta boxes from Yoast SEO, the PublishPress plugin, TaxoPress, and others.

View Metaboxes
View Metaboxes

Option #1. Hide the Meta Boxes for Yourself

This first option allows you to hide the meta boxes when you are editing posts.

  • Click the three dots in the top-right corner of the screen.
Three Dots
Three Dots
  • Scroll to the bottom of the panel that appears in the right sidebar.
  • Click the “Preferences” link.
Preferences Metaboxes
Preferences Metaboxes
  • Click the “Panels” tab.
  • In the “Additional” area, you can disable any meta boxes that you don't want to see.
Panels
Panels 1

Option #2. Hide Meta Boxes for Everyone

If you want to remove meta boxes for all users on your site, I recommend using a code solution.

In the image below, I have two meta to remove: Yoast SEO, and also the custom fields feature in the WordPress core:

2 Metaboxes
2 Metaboxes

First, we'll try some custom code.

Add this to your theme's functions.php file and you will disable the meta boxes for all users when they are editing posts. The “Custom Fields” metabox is covered by the line “postcustom”. You can expand this code with more lines for “pages” and other post types.

function remove_meta_boxes() {
  # Removes meta from Posts #
  remove_meta_box('postexcerpt','post','normal' ); 
  remove_meta_box('postcustom','post','normal');
  remove_meta_box('trackbacksdiv','post','normal');
  remove_meta_box('commentstatusdiv','post','normal');
  remove_meta_box('commentsdiv','post','normal');
}
add_action('admin_init','remove_meta_boxes');

You can find the name of each metabox by using the inspect tools in your browser. In the example, below, we will need wpseo_meta to target the metabox for Yoast SEO.

Debug Wp Metabox
Debug Wp Metabox

Option #3. Hide meta boxes for some roles

An alternative approach is to use the Adminimize plugin.

  • After installing Adminimize, go to Settings > Adminimize.
  • Go to the “Write options – Post” tab.
  • In the “Your own options” area, enter the ID for the div you want to hide. In the smaller box on the left, enter a human readable name.
  • Click “Update Options”.
Adminimize Yoast
Adminimize Yoast
  • Your new setting will now be available in the main area of the Admimize screen. In the “Yoast SEO” row, you can check the boxes for all the user roles.
Adminimize Yoast Disable
Adminimize Yoast Disable

Tags:


Leave a Reply

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

Professional publishing plugins for WordPress! Get PublishPress