/** * Redirect users only once—right after they set their password for the first time. * * Users will be sent to: * https://fireforlife.health/courses/fire180/ * after their first password setup. No more redirects after that. */ function ff_health_redirect_after_first_password_set( $user ) { // Check if this is their first time setting a password if ( ! get_user_meta( $user->ID, 'ff_password_set_once', true ) ) { // Mark that they have now set their password update_user_meta( $user->ID, 'ff_password_set_once', 1 ); // Perform a safe redirect to your welcome page wp_safe_redirect( 'https://fireforlife.health/courses/fire180/' ); exit; } } add_action( 'after_password_reset', 'ff_health_redirect_after_first_password_set', 10, 1 );