WordPress.org

Ready to get started?Download WordPress

Forums

Confirmation on how to mass delete 0 post registered users (3 posts)

  1. pookieguy
    Member
    Posted 2 years ago #

    Hello all,

    A while back I did briefly post this question and one extremely helpful forum member provided the following option...

    BE SURE TO BACK UP YOUR DATABASE FIRST!!

    To select users who have no posts or comments, you can use this:

    SELECT *
    FROM wp_users
    WHERE ID NOT IN
    (SELECT post_author FROM wp_posts
    UNION SELECT user_id FROM wp_comments)
    Then, replace 'SELECT *' with 'DELETE' to actually delete the records.
    You will then have some 'orphan' records in wp_usermeta. Select them with this:

    SELECT *
    FROM wp_usermeta
    WHERE user_id NOT IN
    (SELECT ID FROM wp_users)
    Then, replace 'SELECT *' with 'DELETE' to actually delete the records.

    I continue to get a very massive amount of new registrations with no posts and would like to delete them all from the database. Just wondering if the above is indeed a safe option to do this. If not, can you please provide another easy method to manage this issue?

    Thank you all,

    --mike

  2. pookieguy
    Member
    Posted 2 years ago #

    anyone has some recommendations or can confirm this option will work without damage to site/database?

    Thank you,

    -mike

  3. pookieguy
    Member
    Posted 2 years ago #

    Anyone have some comments or suggestions on this?

    Thank you very much.

    --mike

Topic Closed

This topic has been closed to new replies.

About this Topic