홈 > 프로그래밍 > 웹

aws lightsail bitnami mysql basic command and delete wordpress users f…

드리머즈 0 7656

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;


ab71fcb790b63c2278bb566aaec57d1e_1557744237_528.png
 


a.BEFORE

ab71fcb790b63c2278bb566aaec57d1e_1557744283_5266.png 


b.AFTER
ab71fcb790b63c2278bb566aaec57d1e_1557744283_5453.png
 

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;


ab71fcb790b63c2278bb566aaec57d1e_1557744737_7054.png 


FINAL RESULT!

ab71fcb790b63c2278bb566aaec57d1e_1557744776_2172.png
 


Reference: 

https://www3.ntu.edu.sg/home/ehchua/programming/sql/MySQL_Beginner.html 

https://wordpress.org/support/topic/safest-way-to-delete-30000-users-plugin-mysql-wpcli-database-error/

0 Comments
제목