Install Query Monitor to check which scripts and what hook they are using for your role. Keep in mind these scripts may have dependencies.
You should probably start with the Dashboard Widgets API.
function remove_dashboard_meta() {
// get the current user
$user = wp_get_current_user();
// define roles that cannot see the widgets
$blacklisted_roles = array('subscriber');
// remove if the current user has a blacklisted role
if( array_intersect($blacklisted_roles, $user->roles ) ) {
remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );
remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');//since 3.8
}
}
add_action( 'admin_init', 'remove_dashboard_meta' );
To dequeue scripts you can use a combination of these functions:
admin_enqueue_scripts()
wp_deregister_style()
wp_dequeue_style()
wp_dequeue_script()
wp_deregister_script()
function remove_admin_scripts( ) {
// if ( 'edit.php' != $hook ) {
// return;
// }
// get the current user
$user = wp_get_current_user();
// define roles that cannot see the widgets
$blacklisted_roles = array('subscriber');
// get out of this function if the blacklisted roles are now found
if( ! array_intersect($blacklisted_roles, $user->roles ) ) {
return;
}
$jquery_ui = array (
"jquery-ui-widget",
"jquery-ui-mouse",
"jquery-ui-accordion",
"jquery-ui-autocomplete",
"jquery-ui-slider",
"jquery-ui-tabs",
"jquery-ui-draggable",
"jquery-ui-droppable",
"jquery-ui-selectable",
"jquery-ui-position",
"jquery-ui-datepicker",
"jquery-ui-resizable",
"jquery-ui-dialog",
"jquery-ui-button",
);
foreach ( $jquery_ui as $script ) {
wp_deregister_script( $script );
}
}
add_action( 'admin_enqueue_scripts', 'remove_admin_scripts' );