User Meta — Integrations — Pure Metafields

Docs/Integrations/User Meta

User Meta

Add fields to the user-profile screen (Users → Edit User) with the tp_user_meta filter — same field shape as a metabox, different screen and storage.

PHP · functions.php
add_filter( 'tp_user_meta', function( $blocks ) {
    $blocks[] = [
        'title'  => 'Social Profiles',
        'fields' => [
            [ 'id' => 'twitter_url', 'type' => 'text', 'label' => 'Twitter / X URL' ],
        ],
    ];
    return $blocks;
} );

The block appears on both Your Profile and the admin-facing Edit User screen, guarded by a nonce automatically.

Reading a user meta value

User-profile fields save with WordPress's own update_user_meta(), keyed by the field's id — so read them back with plain get_user_meta(), not tpmeta_field() (which targets a post, via the global $post or a post ID).

PHP
$twitter = get_user_meta( $user_id, 'twitter_url', true );
if ( $twitter ) {
    echo esc_url( $twitter );
}
Not the same helper as post meta

This is the one place in the plugin where the read side is plain WordPress core, not a tpmeta_ helper. Mixing up tpmeta_field() and get_user_meta() here is a common mistake.