Mass deleting spam comments in WordPress


Manually removing a large amount of spam comments on your WordPress site can be a daunting task, but fortunately, various tools make this task a bit easier.

This article describes how to use the following mass delete options to quickly delete spam comments on your WordPress site:

Option 1 — Mass delete comments within WordPress

The following steps show you how to mass delete messages using the built-in features within your WP-Admin panel.

  1. Open the WP-Admin panel for your WordPress site.
  2. Click Comments in the left-side panel.
  3. To view more than the default 20 items on a page, click the Screen Options link at the upper right.
  4. Select the number of items you wish to appear on the screen, such as 200. You can determine a number by looking at the number of 'Pending' messages that appear, which may indicate the total amount of spam comments.
  5. Click the Apply button when finished.
  6. Review the comments and then make the following selections:
    • Pending — Click this tab, which only shows the messages that have not been approved and are likely spam comments.
    • AuthorOptional. Click this checkbox to auto-select all the comments. You can also manually select comments as needed.
    • Mark as Spam — Select this option from the 'Bulk Actions' drop-down list.
    • Apply — When finished, click the Apply button to move the selected comments into the Spam folder.

    These steps move the selected comments to the Spam folder, hiding them from visitors. To permanently delete the hidden spam comments from your site, click the Spam tab and then click the Empty Spam button.

Option 2 — Mass delete comments within phpMyAdmin

For advanced use only. Make sure you are careful whenever making adjustments in phpMyAdmin. Any misconfiguration in your database could potentially cause your site to not operate properly.

You can also mass delete comments by logging into your site's phpMyAdmin account and adjusting to the database tables directly.

For more information on phpMyAdmin, see the following article:

To mass delete comments in phpMyAdmin:

  1. Log into phpMyAdmin. For more information on finding your database credentials, see the following article:
  2. Enter the MySQL hostname, username, and password, and then click the Go button to continue.
  3. Click the link for your database in the left menu. This example shows exampledreamhost_com.
    The table list appears for the database directory you clicked:
  4. Check the box that appears next to wp_commentmeta and wp_comments. The name of your comments table may differ depending on the table prefix you choose during your WordPress installation.
  5. After selecting the comments table, locate the 'With selected:' drop-down menu below the table list and then select 'Empty'.

    You should log into your WP-Admin panel and make sure that all the comments are in fact spam before emptying these tables. It is not possible to recover these comments after you empty them.

    The following warning box appears prompting you to confirm:
  6. Click the Yes button to continue. All the comments are then deleted from your WordPress database.

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?