1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

An easier way to delete comments?

Discussion in 'WordPress' started by pianogirl, Apr 25, 2015.

  1. #1
    So I have thousands of spam comments on my website, and I've turned off comments in order to prevent even more.

    I'm slowly getting rid of the 30,000+ comments already there by selecting the box at the top and deleting 20 at a time.

    Is there a quicker way to get rid of them? A 'select all' button maybe or something in the settings that I've overlooked?
     
    pianogirl, Apr 25, 2015 IP
  2. billzo

    billzo Well-Known Member

    Messages:
    961
    Likes Received:
    278
    Best Answers:
    15
    Trophy Points:
    113
    #2
    You should be able to delete the comments directly out of the wp-comments table using SQL. I did a quick search and it looks like this is the case. Backup your database before you start deleting stuff from it and make sure you download a copy if possible. For your reference:

    https://wordpress.org/support/topic/is-there-a-way-to-delete-all-comments-at-once
    https://wordpress.org/support/topic/how-to-remove-thousads-of-approved-spam-comments

    You could put a WHERE clause on your query to delete only comments posted between a start and end time (comment_date) so you will not delete comments outside of when you got hit with spam.

    There are also plugins to help you delete comments.

    https://wordpress.org/support/view/plugin-reviews/delete-all-comments

    But that will delete all of your comments.
     
    billzo, Apr 25, 2015 IP
    pianogirl likes this.
  3. pianogirl

    pianogirl Well-Known Member

    Messages:
    386
    Likes Received:
    186
    Best Answers:
    0
    Trophy Points:
    155
    #3
    @billzo, I'm afraid that's too complicated for me at the moment, but thank you for your message! #newbie
     
    pianogirl, Apr 25, 2015 IP
  4. billzo

    billzo Well-Known Member

    Messages:
    961
    Likes Received:
    278
    Best Answers:
    15
    Trophy Points:
    113
    #4
    Do you have a start and end time for the large amount of spam you received?
     
    billzo, Apr 25, 2015 IP
  5. pianogirl

    pianogirl Well-Known Member

    Messages:
    386
    Likes Received:
    186
    Best Answers:
    0
    Trophy Points:
    155
    #5
    Yeah, an estimated start date.
     
    pianogirl, Apr 25, 2015 IP
  6. Adrian Robertson

    Adrian Robertson Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #6
    I've used this one before with good success
    https://wordpress.org/plugins/batch-comment-spam-deletion/

    of course, the spam might just return unless you have some measure in place to prevent them getting approved in the first place
     
    Adrian Robertson, May 17, 2015 IP
  7. xendurinan

    xendurinan Banned

    Messages:
    736
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #7
    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.
     
    xendurinan, May 28, 2015 IP