Opened 9 months ago
Closed 9 months ago
#63538 closed defect (bug) (duplicate)
User deletion screen becomes unresponsive on sites with large user bases (suggest Select2/AJAX enhancement)
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Users | Keywords: | |
| Focuses: | Cc: |
Description
When attempting to delete a user on a WordPress installation with a large number of users (e.g., WooCommerce stores with tens or hundreds of thousands of accounts), the user deletion screen (/wp-admin/users.php?action=delete) becomes extremely slow or completely unresponsive.
Problem
The bottleneck appears during the rendering of the <select> element used to choose a reassignment target for the posts of the user being deleted. WordPress loads the full user list into this dropdown server-side, resulting in heavy memory usage and slow page loads — sometimes leading to timeout or browser crash.
This step is currently mandatory. Skipping it is not possible via the UI or core behavior.
Steps to reproduce
Install WordPress with WooCommerce (or any plugin generating many user accounts).
Programmatically insert 50,000+ users.
Go to Users > Select a user to delete.
Click “Delete”.
Observe the browser freezing on the user deletion confirmation screen.
Expected behavior
The confirmation screen should remain responsive regardless of the number of users in the database. Ideally, the reassignment field should support scalable lookups.
Proposed solution
Enhance the reassignment dropdown field to use Select2 with AJAX support, similar to how users are selected in other parts of the admin (e.g., wp_dropdown_users() fallback replacement with AJAX-backed search).
Additional context
Tested on WP 6.5.4 and trunk.
Same behavior occurs with all plugins disabled and using the default Twenty Twenty-Four theme.
Environment: Ubuntu 22.04, PHP 8.1, MySQL 8.0, Chrome 125.
A scalable user search UI in this scenario would avoid rendering thousands of <option> elements and improve UX significantly for administrators managing large sites.
Let me know if a patch or enhancement proposal would be welcomed.
Hi @odirlon, Welcome to WordPress Trac.
This issue is already being tracked in #19867.