[wp-hackers] Clearing out bot users

Kevin Newman CaptainN at unFocus.com
Thu Feb 17 16:30:24 UTC 2011


On 2/17/11 1:43 AM, Sergey Biryukov wrote:
> DELETE u, mv
> FROM wp_users AS u
> JOIN wp_usermeta AS mv ON mv.user_id = u.ID
> WHERE mv.meta_key = 'wp_capabilities' AND mv.meta_value LIKE '%subscriber%'
> AND ( SELECT count(*) FROM wp_comments AS c WHERE c.user_id = u.ID )<= 0
> AND ( SELECT count(*) FROM wp_posts AS p WHERE p.post_author = u.ID )<= 0
Wouldn't that only delete 1 row in wp_users and 1 row in wp_usermeta? 
There would be multiple rows in wp_usermeta to delete.

Kevin N.




More information about the wp-hackers mailing list