I have registration open on a blog of mine and there are plenty of accounts created which are not active.
Looking for a SQL query that can help me get rid of authors with zero posts.
I have registration open on a blog of mine and there are plenty of accounts created which are not active.
Looking for a SQL query that can help me get rid of authors with zero posts.
That's an easy one.
DELETE FROM blog_users WHERE ID NOT IN (
SELECT post_author
FROM blog_posts
);
DELETE FROM blog_usermeta WHERE user_id NOT IN (
SELECT ID
FROM blog_users
)
Change the "blog_" to your table prefix.
is this a single query? can i run directly from phpmyadmin?
This topic has been closed to new replies.