Re: Delete users with no posts
We could make another query to delete usermeta where the id doesn’t appear in wp_users.
I’m not crazy about deleting rows entirely but I guess it could not hurt if the user id # never gets reused, which mysql should not do.
Definitely do a backup first.
This will show all “orphaned” usermeta:
SELECT user_id,meta_key, umeta_id FROM wp_usermeta
LEFT JOIN wp_users ON user_id=ID
WHERE ID is NULL
so delete the wp_users rows first using the first query and then delete the orphaned usermeta