How to remove the posts button from wordpress

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' );
}
  • remove post type, remove posts button, wordpress code, wordpress functions
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

customised wordpress wp-config file

Out of the box, the WordPress wp-config.php file is basic and ugly.Below is our standard...

Fix WordPress 404 Errors on Password Protected Directories

You are reading this article becasue you have applied password protection on the wp-admin...

Enable Fenced Off Debugging to Your IP in Wordpress

Use the code below to activate the bugging in WordPress but locked down to your IP.Put this in...

How to protect your Wordpress Login from Bots

You are reading this article because you are getting a lot of attacks on your WordPress login...

SVG Logo is not appearing in Wordpress

You are reading this article because you have managed to upload an SVG file to your Wordpress...