Is there a way to delete all WordPress authors which have 0 posts?
A:
Go into the admin panel and delete them?
Or do you have thousands to delete?
John at CashCommons
2010-01-06 19:43:03
Assume there are thousands.
Robert Harvey
2010-01-06 19:55:34
I literally have 1000s of users. It's not that my blog is very popular - but many of the users are automatically generated. So deleting them one by one is rather tedious.
bosh
2010-01-09 03:41:21
+1
A:
To see each user and the number of posts of which he or she is the author:
select user_login, (select count(*) from wp_posts where post_author = wp_users.ID)
from wp_users
I'm not sure if it's safe to just delete rows from the wp_users
table just because the user hasn't posted anything. There may be references to the account from other tables. It should, however, be safe to set the password:
update wp_users wp_users left join wp_posts on wp_users.ID = post_author
set user_pass = 'blocked'
where post_author is null
Vebjorn Ljosa
2010-01-06 19:49:27