wordpress dashboard data remove

0
305

You can easily remove dashboard data following code use active template function.php file
if ( ! class_exists( 'Featured_Content' ) && 'plugins.php' !== $GLOBALS['pagenow'] ) {
require get_template_directory() . '/inc/featured-content.php';
}

function hide_update_notice_to_all_but_admin_users()
{
if (!current_user_can(‘update_core’)) {
remove_action( ‘admin_notices’, ‘update_nag’, 3 );
}
}
add_action( ‘admin_head’, ‘hide_update_notice_to_all_but_admin_users’, 1 );

function remove_core_updates(){
global $wp_version;return(object) array(‘last_checked’=> time(),’version_checked’=> $wp_version,);
}
add_filter(‘pre_site_transient_update_core’,’remove_core_updates’);
add_filter(‘pre_site_transient_update_plugins’,’remove_core_updates’);
add_filter(‘pre_site_transient_update_themes’,’remove_core_updates’);

add_filter(‘screen_options_show_screen’, ‘__return_false’);

add_filter( ‘contextual_help’, ‘mytheme_remove_help_tabs’, 999, 3 );
function mytheme_remove_help_tabs($old_help, $screen_id, $screen){
$screen->remove_help_tabs();
return $old_help;
}

add_action( ‘admin_menu’, ‘my_remove_menu_pages’, 999 );

function my_remove_menu_pages() {
remove_menu_page( ‘index.php’ ); //Posts
remove_menu_page( ‘edit.php’ ); //Posts
remove_menu_page( ‘upload.php’ ); //Media
remove_menu_page( ‘edit-comments.php’ ); //Comments
remove_menu_page( ‘themes.php’ ); //Appearance
remove_menu_page( ‘users.php’ ); //Users
remove_menu_page( ‘tools.php’ );
remove_menu_page( ‘plugins.php’ );
remove_menu_page( ‘edit.php?post_type=page’ ); //Tools
remove_menu_page( ‘options-general.php’ ); //Settings
remove_menu_page( ‘edit.php?post_type=acf’ );
remove_menu_page( ‘wpcf7’ );
};

function remove_dashboard_widgets () {

remove_meta_box(‘dashboard_quick_press’,’dashboard’,’side’); //Quick Press widget
remove_meta_box(‘dashboard_recent_drafts’,’dashboard’,’side’); //Recent Drafts
remove_meta_box(‘dashboard_primary’,’dashboard’,’side’); //WordPress.com Blog
remove_meta_box(‘dashboard_secondary’,’dashboard’,’side’); //Other WordPress News
remove_meta_box(‘dashboard_incoming_links’,’dashboard’,’normal’); //Incoming Links
remove_meta_box(‘dashboard_plugins’,’dashboard’,’normal’); //Plugins
remove_meta_box(‘dashboard_right_now’,’dashboard’, ‘normal’); //Right Now
remove_meta_box(‘rg_forms_dashboard’,’dashboard’,’normal’); //Gravity Forms
remove_meta_box(‘dashboard_recent_comments’,’dashboard’,’normal’); //Recent Comments
remove_meta_box(‘icl_dashboard_widget’,’dashboard’,’normal’); //Multi Language Plugin
remove_meta_box(‘dashboard_activity’,’dashboard’, ‘normal’); //Activity
remove_action(‘welcome_panel’,’wp_welcome_panel’);

}

add_action(‘wp_dashboard_setup’, ‘remove_dashboard_widgets’);
add_filter(‘show_admin_bar’, ‘__return_false’);

remove_action(‘welcome_panel’, ‘wp_welcome_panel’);