Remove default post type from admin bar

If you are building a website for a client and there is no need for them to access the "post", for example, if they are not going to do any blogging, then use the code below to remove it from the sidebar.

The result will be that the "Posts" button is removed from the sidebar so client cant access it.

NOTE: deregistering the post type completely is NOT RECOMMENDED, so whilst you can "hide" the link to posts type, avoid deregistering. 

####################
# Remove default post type from admin bar
# See: https://www.jucra.com/whmcs/knowledgebase/126/
####################
add_action( 'admin_menu', 'remove_default_post_type' );
function remove_default_post_type() {
    remove_menu_page( 'edit.php' );
}
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Your PHP installation appears to be missing the MySQL extension which is required by WordPress

You are reading this article because you are seeing a message on your website: Your PHP...

How to Add JUCRA Digital as a member of your Stripe account

You are reading this article because JUCRA needs access to your stripe accountThe very best and...