deleting large # of users performance issue
-
I am trying to delete a large number of users and finding it to run very slow. I am using a get_users followed by a simple loop calling wp_delete_user. It seems to be taking 9-15 seconds per user. With thousands of users to delete, this could take days.
Is there a way to speed it up?
<?php define( 'WP_USE_THEMES', false ); require( './wp-load.php' ); $args = array( 'number' => 50, 'role' => 's2member_level1' // Modify to match your needs ); $reassignto = 1618; $users_to_delete = get_users( $args ); require_once( ABSPATH.'wp-admin/includes/user.php' ); foreach( $users_to_delete as $user_to_delete ) : wp_delete_user( $user_to_delete->ID, $reassignto ); endforeach;
BTW-I had tried a few plugins and found them to be even slower.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘deleting large # of users performance issue’ is closed to new replies.