In this article we'll discuss a method for cleaning up spam comments from your WordPress database using phpMyAdmin.

If you followed along with our previous 320: WordPress comment spam clean up article this would be one of the more advanced methods mentioned in that article.

Our next article in this series 322: WordPress advanced comment spam clean up with query is an even more advanced method to help remove comment spam from your database.

Multiple entry removal via search

In our previous example from the first comment spam clean up article we noticed that a lot of the comment_author spam had the word "payday" in it with variations. You can utilize the Search functionality of phpMyAdmin to help in the process of finding all of these entries and quickly removing them.

  1. First you'll need to get to your WordPress database via the phpMyAdmin interface
  2. Click on the Search tab at the top
    wp-comments-search-tab
  3. In the first field Word(s) or value(s) to search for: type %payday%.
    The reason you place a % symbol at the beginning and end of the word
    is because that means a wildcard character (any character at all).
    This way we'll find entries for loan payday as well as payday loans.

    Leave the Find: option as the default of at least one of the words.

    In the Inside table(s): menu click on wp_comments to only search within that table

    Next to the Inside column: field enter in comment_author, then finally click Gowp-comments-search-values
  4. Click on Browse to see the results of your search wp-comments-search-browse
  5. You'll notice we have 103 matches for our search, but we're only seeing rows 0-29, because of the default entry beside Show: of only 30
    wp-comments-search-display-default-30


    You can either go through one page at a time with 30 items per page, or if you prefer you can increase the limit beside Show: up to 103 to show all of our search results at once. You'll want to also change the starting from row # option to 0 to begin at the first result, then click on Show:
    wp-comments-search-display-default-103
  6. Now in this case because we're looking at just the comment_author field, it's very unlikely a legitimate comment user is going to use the word "payday" anywhere in their name. So scroll to the very bottom of the page and click on Check Allwp-comments-search-check-all
  7. Now that all entries have been checked, click on the Delete icon at the bottomwp-comments-search-check-all-delete
  8. Now scroll to the bottom of all the DELETE confirmations, and click Yes
    wp-comments-search-confirm-delete-topwp-comments-search-confirm-delete-bottom

    Finally you should see MySQL return an empty result set, as it's trying to do our search again, but now all those entries have been removedwp-comments-search-confirm-delete-done
Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

News / Announcements

WordPress wp-login.php brute force attack
Updated 2014-07-17 06:43 pm EST
Hits: 201697

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!