如何批量删除所有WordPress订阅者? 时间:2017-04-22 作者:Vinnie James 我有20000个假订户,我想除掉。“管理”面板一次仅允许删除200个。如何通过MySQL批量删除所有Wordpress订阅服务器? 2 个回复 SO网友:Vinnie James 我最终通过以下两个查询删除了所有没有发表帖子的用户:首先:DELETE FROM wp_users WHERE ID NOT IN (SELECT post_author FROM wp_posts) 第二个:DELETE FROM wp_usermeta WHERE user_id NOT IN (SELECT ID FROM wp_users) SO网友:Punitkumar Patel You can use : <?php $blogusers = get_users( \'role=subscriber\' ); // Array of WP_User objects. foreach ( $blogusers as $user ) { $user_id = $user->ID; wp_delete_user( $user_id ); } 文章导航