adding custom user input fields in WordPress admin dashboard gives error The link you followed has expired. Please try again

That error messages means a failed admin nonce validation (check_admin_referer, which calls wp_nonce_ays). And you don’t actually need an extra nonce here: these are extra fields to be added to existing forms that already have their own nonces, and the one you’ve added just clashes with them. (If you were adding a new form you would need these, yes.)

So I think the fix is to remove

<?php wp_nonce_field( '_themename_user_extra_fields_verify' ); ?>

and

check_admin_referer( '_themename_user_extra_fields_verify' );

and the forms will still be secure. I don’t think you need the user edit permissions check either.


That all said, you could implement Facebook and Twitter as extra contact info fields instead:

function wpse_376873_add_contactmethods( $contactmethods ) {
    $contactmethods['facebook'] = __( "Facebook Profile Link", "_themename" );
    $contactmethods['twitter'] = __( "Twitter Profile Link","_themename" );

    return $contactmethods;
}
add_filter( 'user_contactmethods', 'wpse_376873_add_contactmethods', 10, 1 );

and most of this should just work automatically without having to write HTML for the fields. I don’t think you can set extra field descriptions though as you have for your own fields.