Sometimes, when you register a custom post type, you may want to hide “add new” buttons on wp-admin menu and edit page, to keep a fixed number of posts to be managed by the user without changing the original website concept or design.
Just paste the code bellow on your theme functions.php file, and the “add new” buttons will be hidden from wp-admin users.
// hide "add new" on wp-admin menu
function hd_add_box() {
global $submenu;
unset($submenu['edit.php?post_type=yourcustomposttype'][10]);
}
// hide "add new" button on edit page
function hd_add_buttons() {
global $pagenow;
if(is_admin()){
if($pagenow == 'edit.php' && $_GET['post_type'] == 'yourcustomposttype'){
echo ".add-new-h2{display: none;}";
}
}
}
add_action('admin_menu', 'hd_add_box');
add_action('admin_head','hd_add_buttons');



