# LifterLMS: Courses Column in the Users List

> Adds a "Courses" column to the Users screen showing how many LifterLMS courses each user is enrolled in.

- Type: PHP
- Runs: Admin only
- Category: [Courses & Community](https://wpide.com/library/category/learning/)
- Tags: lifterlms, users, reporting
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/lifterlms-enrollments-users-column/

## Code

```php
if ( ! function_exists( 'llms_get_student' ) ) {
    return;
}

add_filter( 'manage_users_columns', function ( $columns ) {
    $columns['wpide_llms_courses'] = 'Courses';

    return $columns;
} );

add_filter( 'manage_users_custom_column', function ( $output, $column, $user_id ) {
    if ( 'wpide_llms_courses' !== $column ) {
        return $output;
    }

    $student = llms_get_student( $user_id );
    $courses = $student ? $student->get_courses( array( 'limit' => 1 ) ) : array();
    $found   = (int) ( $courses['found'] ?? 0 );

    if ( ! $found ) {
        return '&mdash;';
    }

    return sprintf(
        '<a href="%1$s">%2$s</a>',
        esc_url( admin_url( 'admin.php?page=llms-reporting&tab=students&student_id=' . (int) $user_id ) ),
        esc_html( sprintf( _n( '%d course', '%d courses', $found ), $found ) )
    );
}, 10, 3 );
```

## Notes

Links to the student's LifterLMS reporting page for details.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "LifterLMS: Courses Column in the Users List" 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/
