# Skip the Dashboard for Chosen Roles

> Sends users with certain roles straight to a more useful screen, like the Posts list, whenever they open the dashboard.

- Type: PHP
- Runs: Admin only
- Category: [Dashboard](https://wpide.com/library/category/dashboard/)
- Tags: dashboard, redirect, roles
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/skip-dashboard-for-roles/

## Code

```php
// Role => admin page to open instead of the dashboard.
$wpide_dashboard_redirects = array(
    'author'      => 'edit.php',
    'contributor' => 'edit.php',
    'shop_manager' => 'admin.php?page=wc-orders',
);

add_action( 'load-index.php', function () use ( $wpide_dashboard_redirects ) {
    $user = wp_get_current_user();

    foreach ( (array) $user->roles as $role ) {
        if ( isset( $wpide_dashboard_redirects[ $role ] ) ) {
            wp_safe_redirect( admin_url( $wpide_dashboard_redirects[ $role ] ) );
            exit;
        }
    }
} );
```

## Notes

Administrators are never redirected unless you add the administrator role to the list.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Skip the Dashboard for Chosen Roles" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
