WordPress.org

Forums

Delete users with no posts (6 posts)

  1. hoder
    Member
    Posted 11 years ago #

    What's the MySQL command for deleting users with no posts written, or not loggin since a particular day, etc.? Is there a plugin for this kind of stuff?

  2. exposure
    Member
    Posted 11 years ago #

    You can delete them through the admin panel

  3. hoder
    Member
    Posted 11 years ago #

    I know. I mean not manually. Because there might be thousands of them.

  4. hoder
    Member
    Posted 11 years ago #

    It must be a very simple MySQL command line. Anyone? Please. My database is exploding...

  5. rossz
    Member
    Posted 11 years ago #

    If you are running MySQL 4.1 (does not work with 4.0), you can do this:

    delete from users where id not in (select distinct post_author from posts) and user_login != 'admin';

    I added the extra check for the user "admin" because I never post with that account.

    This does NOT check if the person has posted comments. You might want to consider that before running the query.

  6. hoder
    Member
    Posted 10 years ago #

    My host is actually using version 4.0. How can I use this in that version?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.