# Record Where Each User Signed Up

> Notes how every new account was created (registration form, admin screen, checkout, REST API or WP-CLI) and shows it in a "Signed up via" column on the Users screen.

- Type: PHP
- Runs: Run everywhere
- Category: [Users](https://wpide.com/library/category/users/)
- Tags: registration, users, reporting
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/registration-source-column/

## Code

```php
add_action( 'user_register', function ( $user_id ) {
    if ( defined( 'WP_CLI' ) && WP_CLI ) {
        $source = 'WP-CLI';
    } elseif ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
        $source = 'REST API';
    } elseif ( did_action( 'woocommerce_checkout_process' ) || did_action( 'woocommerce_before_checkout_process' ) ) {
        $source = 'Checkout';
    } elseif ( is_admin() && current_user_can( 'create_users' ) && ! wp_doing_ajax() ) {
        $source = 'Admin';
    } elseif ( isset( $GLOBALS['pagenow'] ) && 'wp-login.php' === $GLOBALS['pagenow'] ) {
        $source = 'Registration form';
    } else {
        $source = 'Front-end form';
    }

    update_user_meta( $user_id, 'wpide_signup_source', $source );
} );

add_filter( 'manage_users_columns', function ( $columns ) {
    $columns['wpide_signup_source'] = 'Signed up via';

    return $columns;
} );

add_filter( 'manage_users_custom_column', function ( $output, $column, $user_id ) {
    if ( 'wpide_signup_source' === $column ) {
        $source = get_user_meta( $user_id, 'wpide_signup_source', true );
        $output = $source ? esc_html( $source ) : '&mdash;';
    }

    return $output;
}, 10, 3 );
```

## Notes

Only accounts created after activation are labelled.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Record Where Each User Signed Up" 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/
