# "Member Since" Shortcode

> Adds a [wpide_member_since] shortcode that shows the date the logged-in member joined, or how long ago, for welcome messages and account pages.

- Type: PHP
- Runs: Run everywhere
- Category: [Users](https://wpide.com/library/category/users/)
- Tags: members, shortcode, account
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/member-since-shortcode/

## Code

```php
add_shortcode( 'wpide_member_since', function ( $atts ) {
    $atts = shortcode_atts( array( 'format' => '' ), $atts, 'wpide_member_since' );

    if ( ! is_user_logged_in() ) {
        return '';
    }

    $joined = strtotime( wp_get_current_user()->user_registered . ' UTC' );

    if ( 'relative' === $atts['format'] ) {
        return esc_html( human_time_diff( $joined ) );
    }

    return esc_html( wp_date( $atts['format'] ? $atts['format'] : get_option( 'date_format' ), $joined ) );
} );
```

## Notes

Use [wpide_member_since format="relative"] for "3 months", or any PHP date format such as format="F Y".

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find ""Member Since" Shortcode" 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/
