Remove Unwanted Meta Boxes In WordPress

When create websites for clients using WordPress, especially for non-blogging purposes where custom post types are used, you might want to remove unnecessary meta boxes in post editing page to keep the page clean and easy to operate. To reach that goal, simply put these lines in functions.php file of your theme:

add_action( 'admin_menu', function(){
    remove_meta_box( 'postexcerpt', 'post', 'normal' );
    remove_meta_box( 'postcustom', 'post', 'normal' );
    remove_meta_box( 'trackbacksdiv', 'post', 'normal' );
    remove_meta_box( 'slugdiv', 'post', 'normal' );
    remove_meta_box( 'authordiv', 'post', 'normal' );
    remove_meta_box( 'commentstatusdiv', 'post', 'normal' );
}

Change post to custom post type slug if you want to remove meta boxes in editing page for custom post type.

For more information about remove_meta_box() function, please read the Codex.

🔥 HOT: Interested in boosting your WordPress SEO? My Slim SEO plugin is a super lighweight and automated plugin that handles most the hard work for you: meta tags, sitemap, redirection, schema & link building.

👉 Have a look and you will love it: wpslimseo.com

Leave a Reply

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


Copyright © 2024 Deluxe Blog Tips. All rights reserved.

My products: Meta Box | Slim SEO