aws lightsail bitnami mysql basic command and delete wordpress users f…
I tried to delete all spam and pending users(about 40k users..) by using wordpress bullk delete plugin but my server suddenly stopped.(crashed?)
I also tried to delete the users by insterting some code in functions.php in theme but it also stopped my server.
So I did the job by using mysql.
1. show databases;
2. use bitnami_wordpress;
3. show tables;
4. describe wp_users;
5. select * from wp_users;
6. SELECT COUNT(*) AS `Count` FROM wp_users;
7. SELECT COUNT(*) AS 'Count' FROM wp_usermeta;
8. select * from wp_users limit 10;
9. select * from wp_usermeta limit 10;
10. DELETE FROM wp_usermeta WHERE user_id > 300;
11. DELETE FROM wp_users WHERE ID > 300;
a.BEFORE
b.AFTER
um.. good! but still Pending users are exist.
12. SELECT COUNT(*) AS `Count` FROM wp_signups;
13. DELETE FROM wp_signups WHERE signup_id > 300;
FINAL RESULT!
Reference:
https://www3.ntu.edu.sg/home/ehchua/programming/sql/MySQL_Beginner.html