How to remove the posts button from wordpress Print

  • remove post type, remove posts button, wordpress code, wordpress functions
  • 2

You are reading this article because you want to remove the "Posts" button within the WordPress admin area.



In some cases, you or your client does not need to see this button, as they won't be using posts.

Below are three functions you can add to your functions.php to remove it from the admin.

##############################
# Remove default Posts button and type from WordPress admin
# See: https://www.jucra.com/whmcs/knowledgebase/168/
##############################

//Remove side menu
add_action( 'admin_menu', 'remove_default_post_type' );
function remove_default_post_type() {
    remove_menu_page( 'edit.php' );
}

// Remove +New post in top Admin Menu Bar
add_action( 'admin_bar_menu', 'remove_default_post_type_menu_bar', 999 );
function remove_default_post_type_menu_bar( $wp_admin_bar ) {
    $wp_admin_bar->remove_node( 'new-post' );
}

// Remove Quick Draft Dashboard Widget
add_action( 'wp_dashboard_setup', 'remove_draft_widget', 999 );
function remove_draft_widget(){
    remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
}

Was this answer helpful?

« Back