How to delete all subscribers (about 50k), without overloading the server?



Hi @t-p

I already checked that actually, this plugin is overloading my server. Need a more efficient way.


You could list fewer users per page, which means having to do the same thing many more times. It’ll work, but it’s hardly efficient.

A custom script could be created that gets x number of users at once, then loops through each user and deletes all related data before removing the user itself. Schedule a WP Cron task to repeat the same script at some reasonable interval. Tailor x to be as large as possible to work reliably without overloading anything.

Once no more users matching the criteria can be found, I believe the script can remove itself from the cron tasks. But if the script simply returns when no users are found, it wouldn’t have a huge impact if it just kept running until you have a chance to manually remove it.

I will start a new thread.

Source link