How to Hide WordPress Metaboxes 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 plugins, 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 “metaboxes” 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 metaboxes from , the PublishPress plugin, TaxoPress, and others.

View Metaboxes
View Metaboxes

Option #1. Hide the 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 some roles

The Pro version of the PublishPress Capabilities plugin allows you to hide metaboxes for specific user roles.

In the image below, you can see two metaboxes:

  • “Yoast SEO” from the Yoast SEO plugin.
  • “Editorial Comments” from the PublishPress plugin.
Metaboxes
Metaboxes

To hide these metaboxes, follow these steps:

  • Go to “PublishPress”, then “” in your WordPress admin menu.
  • Choose the user role you want to hide the metaboxes for:
Hide Metaboxes Roles
Hide Metaboxes Roles
  • Scroll down to the bottom and find the “Metaboxes” area. If you don't see all your metaboxes, go to edit a post and then reload this “Editor Features” screen.
Metaboxes
Metaboxes
  • Place a red X for any metabox you want to hide. In the image below, we are hiding both the “Yoast SEO” and “Editorial Comments” metaboxes.
Hide Metaboxes WordPress
Hide Metaboxes WordPress
  • Click “Save Changes”.
  • Visit the post editing screen as a user in the role you selected. You will no longer see the metaboxes you selected.

Option #3. 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

Tags: Admin Toolbar, Dashboard Widgets, Editor Features, Meta boxes, TaxoPress, Yoast SEO


Leave a Reply

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

Professional publishing plugins for WordPress! Get PublishPress

  • SUBSCRIBE TO OUR NEWSLETTER
  • SEARCH THIS SITE