# Record and Show the Registration IP Address

> Saves the IP address each new account was created from and shows it in the Users list, which helps spot bulk fake sign-ups.

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

## Code

```php
add_action( 'user_register', function ( $user_id ) {
    if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
        $ip = filter_var( wp_unslash( $_SERVER['REMOTE_ADDR'] ), FILTER_VALIDATE_IP );
        if ( $ip ) {
            update_user_meta( $user_id, 'wpide_registration_ip', $ip );
        }
    }
} );

add_filter( 'manage_users_columns', function ( $columns ) {
    if ( current_user_can( 'manage_options' ) ) {
        $columns['wpide_reg_ip'] = 'Registration IP';
    }

    return $columns;
} );

add_filter( 'manage_users_custom_column', function ( $output, $column, $user_id ) {
    if ( 'wpide_reg_ip' === $column ) {
        $ip = get_user_meta( $user_id, 'wpide_registration_ip', true );

        return $ip ? '<code>' . esc_html( $ip ) . '</code>' : '&#8212;';
    }

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

## Notes

IP addresses are personal data, so mention them in your privacy policy (behind a proxy you may see the proxy address).

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Record and Show the Registration IP Address" 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/
