Manually removing a large amount of spam comments on your WordPress site can be a daunting task, but fortunately there are various tools that 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.
- Open the WP-Admin panel for your WordPress site.
- Click Comments in the left-side panel.
- In order to view more than the default 20 items on a page, click the Screen Options link at the upper right.
- The following dialog box expands from the top:
- Select the number of items you wish to appear on the screen, such as 200. You can determine a number by the looking at the number of 'Pending' messages that appear, which may indicate the total amount of spam comments.
- Click the Apply button when finished.
- Review the comments and then make the following selections:
- Pending — Click this tab, which shows you only the messages that have not been approved and are likely spam comments.
- Author — Optional. 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.
- To permanently delete the 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 making adjustments directly to the database tables.
For more information on phpMyAdmin, see the following article:
To mass delete comments in phpMyAdmin:
- Log into phpMyAdmin. For more information on finding your database credentials, see the following article:
- Enter the MySQL hostname, username, password, and then click the Go button to continue.
- The phpMyAdmin dashboard page opens showing you all the tables in your database. The directories for the database appear in the left-hand panel:
- Click the link for your website at the top. This example shows
- The table list appears for the database directory you clicked:
- 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.
- 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:
- Click the Yes button to continue. All the comments are then deleted from your WordPress database.