# Primary Site and Profile Links on Network Users Rows

> Adds two hover links under each user in Network Admin > Users, one to the dashboard of their first site (with their site count) and one straight to their profile.

- Type: PHP
- Runs: Admin only
- Category: [Multisite](https://wpide.com/library/category/multisite/)
- Tags: network-admin, users, row-actions
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/ms-users-extra-row-actions/

## Code

```php
if ( ! is_multisite() ) {
    return;
}

add_filter( 'ms_user_row_actions', function ( $actions, $user ) {
    $blogs = get_blogs_of_user( $user->ID );

    if ( $blogs ) {
        $first = reset( $blogs );
        $actions['wpide_dashboard'] = sprintf(
            '<a href="%1$s">%2$s</a>',
            esc_url( get_admin_url( $first->userblog_id ) ),
            /* translators: %d: number of sites */
            esc_html( sprintf( _n( 'Primary site (%d site)', 'Primary site (%d sites)', count( $blogs ) ), count( $blogs ) ) )
        );
    }

    $actions['wpide_profile'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( network_admin_url( 'user-edit.php?user_id=' . (int) $user->ID ) ), esc_html__( 'Profile' ) );

    return $actions;
}, 10, 2 );
```

## Notes

""

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Primary Site and Profile Links on Network Users Rows" 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/
