Auto approve new users userpro

To auto-approve new users in UserPro, you can follow these steps:

Method 1: Using UserPro's built-in feature

  1. Log in to your WordPress dashboard and navigate to UserPro > Settings.
  2. Scroll down to the Registration section.
  3. Under New User Registration, select Auto-approve new users from the dropdown menu.
  4. Click Save Changes.

Method 2: Using a plugin

  1. Install and activate the User Role Editor plugin.
  2. Go to User Role Editor > User Roles.
  3. Click on the Edit link next to the Subscriber role (or the role you want to auto-approve).
  4. Scroll down to the Capabilities section.
  5. Under Capabilities, find the edit_posts capability and click on the Edit link next to it.
  6. In the Edit Capability page, select Allow for the edit_posts capability.
  7. Click Save Changes.

Method 3: Using a code snippet

  1. Add the following code snippet to your theme's functions.php file:
    function auto_approve_new_users($user_id) {
     $user = new WP_User($user_id);
     $user->set_role('subscriber');
    }
    add_action('wp_new_user', 'auto_approve_new_users');

    This code will automatically set the new user's role to Subscriber (or any other role you specify) when they register.

Note: Make sure to replace 'subscriber' with the actual role you want to auto-approve.

After implementing one of these methods, new users will be automatically approved and will have the specified role assigned to them.