Auto approve new users if their username is included in a predefined list

You might put this code in functions.php : $GLOBALS[‘allowed_users’]= [‘mikejordan’, ‘jamesbrown’, …]; add_action(‘user_register’,’my_function’); function my_function($user_id){ // get user data $user_info = get_userdata($user_id); if ( in_array($user_info->login, $GLOBALS[‘allowed_users’] ) ) { $res = $wpdb->query($wpdb->prepare(“SELECT activation_key from {$wpdb->signups} WHERE user_login = %s)”, $user_info->login)); if (!empty($res)) { wpmu_activate_signup( $res->activation_key ); } } }

Is it possible to remove the password field in the registration page in woocommerce?

Use this snippet to create user without password $website = “http://example.com”; $userdata = array( ‘user_login’ => ‘login_name’, ‘user_url’ => $website, ‘user_pass’ => NULL // When creating an user, password is expected. ); $user_id = wp_insert_user( $userdata ) ; //after this you can update user on this way update_user_meta( $user_id, ‘some_meta_key’, $meta_value ); or //create user … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)