Remove Default Post Type from WordPress Backend

This Snippet removes the default post type from your backend. You will not see the post options, you are not able to post default posts. I am using it within landingpage projects where only custom post types are needed. Most of the time I am using it with my „unregister comments from wp backend“ snippet.


/*** Remove Default Post Type ***/

//Remove from Quick Draft
add_action( 'wp_dashboard_setup', 'remove_draft_widget', 999 );

function remove_draft_widget(){
    remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
}
//Remove from +New Post in Admin 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 from the Side Menu
add_action( 'admin_menu', 'remove_default_post_type' );

function remove_default_post_type() {
    remove_menu_page( 'edit.php' );
}

WHERE TO PLACE THIS CODE?

Paste this code into the functions.php within your active child theme.

Pleasure?

Please share your thumbsup, suggestions, edits, and questions within my comment section down there. 

I love posting snippets for you, but with a bit of feedback, it gets even more fun. 😀

Sharing is caring:

Share on xing
Share on linkedin
Share on whatsapp
Share on facebook
Share on twitter
Share on email

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert