WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Is there a way to delete all comments at once?

[Resolved] Is there a way to delete all comments at once?

  • promethea

    @promethea

    I have over 1,600 comments that are spam on my site. I have just installed Akismet, so I think that should solve the problem of future spam, but how do I get rid of the 1,600 comments? It seems I can only delete 20 at a time, which means I will have to do it 80 times. Is there anyway to delete the whole 1,600 at one time?

    Please, please tell me there is!

Viewing 6 replies - 1 through 6 (of 6 total)
  • MichaelH

    @michaelh

    Backup your database first. See WordPress Backups.

    The can use phpMyAdmin to execute this SQL

    DELETE FROM wp_comments WHERE comment_approved = 0

    Of course if your comments table is prefixed with wp_ you will need to use the correct table name.

    Screen options > Comments per page …

    And, one more visual (video) guide:

    [link moderated]

    Moderator Mark Ratledge

    @songdogtech

    Forum Moderator

    In Screen Options you can set the screen to show much more than 20 comments at a time.

    Or, you can run this in PHPMyAdmin:

    delete from wp_comments where comment_approved = ’spam’;

    but backup your database before doing so, etc.

    Thank u Very Much For The Explaining

    Thanks, this worked for me too. I was re-building an old blog with over 30,000 spam comments(!) and Askimet kept timing out, but the method above (via phpmyadmin) worked within seconds.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Is there a way to delete all comments at once?’ is closed to new replies.