Skip to content

Instantly share code, notes, and snippets.

@MrJoshFisher
Created September 13, 2023 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrJoshFisher/eda23a4806947eacf681a5bbf629da0f to your computer and use it in GitHub Desktop.
Save MrJoshFisher/eda23a4806947eacf681a5bbf629da0f to your computer and use it in GitHub Desktop.
[Remove Posts] #wordpress
// ************* Remove default Posts type since no blog *************
// 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' );
}
// End remove post type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment