• Resolved Anonymous User 17335794

    (@anonymized-17335794)


    I have almost 16k customers. How to approve in this 16k users account in one time?

    Can you give me any custom code or something?

Viewing 7 replies - 1 through 7 (of 7 total)
  • I’m also interested in this.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @neueweide @anish12345

    You can try updating them via PHPmyadmin or your database console.

    Here’s an example SQL command:
    UPDATE wp_usermeta SET meta_value="approved" WHERE meta_key="account_status";

    Regards,

    Thread Starter Anonymous User 17335794

    (@anonymized-17335794)

    Please give me php code.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @anish12345

    Please create a full backup of your site including the database before adding this code snippet so that you have a restoration point if there’s an issue after updating the user meta.

    Add this to your theme/child-theme functions.php file or use the Code Snippets plugin to run this code once. Remove the code when all user statuses have been updated.

    add_action("init", "um_063021_update_users_statuses");
    function um_063021_update_statuses(){
        global $wpdb;
        $wpdb->query("UPDATE {$wpdb->prefix}usermeta SET meta_value="approved" WHERE meta_key="account_status");
    }

    I still recommend that you check the number of rows for the users that will be affected by the above updates in the PHPMyAdmin or a Database console. Also, take note that the above code will update ALL users’ status to approved.

    Regards,

    Thread Starter Anonymous User 17335794

    (@anonymized-17335794)

    This code not working. Showing this error in code snippets.

    Don’t Panic
    The code snippet you are trying to save produced a fatal error on line 4:

    syntax error, unexpected ‘approved’ (T_STRING), expecting ‘)’
    The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.

    Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @anish12345

    Sorry, there was a typo in the code.

    Please try this one instead:

    add_action("init", "um_063021_update_users_statuses");
    function um_063021_update_statuses(){
        global $wpdb;
        $wpdb->query("UPDATE {$wpdb->prefix}usermeta SET meta_value='approved' WHERE meta_key='account_status'");
    }

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hey there!

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. ??

    Regards,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Bulk User Approved’ is closed to new replies.