替换中的前缀wp_users
和wp_usermeta
使用的表名称
在开始删除用户之前,备份两个表中的数据。
DELETE u FROM wp_users u
LEFT JOIN wp_usermeta um1 ON u.id = um1.user_id AND um1.meta_key = \'first_name\'
LEFT JOIN wp_usermeta um2 ON u.id = um2.user_id AND um2.meta_key = \'last_name\'
WHERE (um1.meta_value IS NULL OR CHAR_LENGTH(um1.meta_value) = 0)
AND (um2.meta_value IS NULL OR CHAR_LENGTH(um2.meta_value) = 0);
DELETE um FROM wp_usermeta um
LEFT JOIN wp_users u ON u.id = um.user_id
WHERE u.id IS NULL;