Did you log in to your WP Dashboard only to find several hundred, if not thousands, of spam comments waiting to be deleted?
If so, here is how to delete all comments on WordPress in one go and save the time and clicks of deleting them one by one, using the following 2 guides.
Mass Delete comments using phpMyAdmin
Before you run any of these queries, take a backup of your database.
Open your hosting control panel (in cPanel, look under Databases) and select phpMyAdmin
In the new page that opens select your database
Scroll down the page and select table wp_comments
If you want to delete all comments, click Empty next to the wp_comments table in the table list, confirm and you’re done. For the queries below, open the SQL tab, paste the query and click Go.
If you want to remove ALL PENDING (NON APPROVED) COMMENTS then run the following query:
DELETE FROM wp_comments WHERE comment_approved = '0';
If you want to remove ALL APPROVED COMMENTS then run the following query:
DELETE FROM wp_comments WHERE comment_approved = '1';
If you want to remove ALL TRASH COMMENTS then run the following query:
DELETE FROM wp_comments WHERE comment_approved = 'trash';
If you want to remove ALL SPAM COMMENTS then run the following query:
DELETE FROM wp_comments WHERE comment_approved = 'spam';
Deleting rows this way leaves their data behind in the wp_commentmeta table. You can clean it up with this query:
DELETE FROM wp_commentmeta WHERE comment_id NOT IN (SELECT comment_ID FROM wp_comments);
The comment counts shown on your posts are not updated by these queries. If you have WP-CLI, you can recount them with wp comment recount $(wp post list --format=ids).
In case your database prefix is not the default one (wp_), replace the wp_ prefix I used with yours.
Need a hand with your WordPress site? Answer four quick questions and see your flat price before you pay. Start here →
Free guidefrom LeDetailWP
WordPress Cleanup Guide
Declutter your WordPress site, clear out what slows it down and find the free plugins that keep it running smoothly.
★★★★★ I highly recommend hiring FixMyWP to fix your website. They are very professional and my issues were resolved within a few hours.
Nico Timmermans
spyglassrockband.com
Mass Delete WordPress Comments using a plugin(or two :D)
Using phpMyAdmin for deleting comments from your WordPress site may be too complicated for some of you, so I suggest taking a look at the following WordPress plugins that will do the job nice and easy.
WPCommentCleaner Delete Pending Comments
Both of these plugins are old and may no longer be available or maintained, so check their WordPress.org pages before you install them. You may not need a plugin at all: in Comments, open the Spam or Trash tab and click Empty Spam or Empty Trash. For pending comments, use Screen Options to show up to 999 comments per page, select them all and choose Move to Trash from the bulk actions.
If you have WP-CLI on your server, this command deletes all spam comments at once:
wp comment delete $(wp comment list --status=spam --format=ids) --force
As always, feel free to comment if you need help or have a question (or even two)!
Need a hand with your WordPress site?
Answer four quick questions and see your flat price before you pay. Most fixes are done the same day or within 24 business hours.
Tutorial: How to Mass Delete Comments in WordPress
Did you log in to your WP Dashboard only to find several hundred, if not thousands, of spam comments waiting to be deleted?
If so, here is how to delete all comments on WordPress in one go and save the time and clicks of deleting them one by one, using the following 2 guides.
Mass Delete comments using phpMyAdmin
Before you run any of these queries, take a backup of your database.
For the queries below, open the SQL tab, paste the query and click Go.
If you want to remove ALL PENDING (NON APPROVED) COMMENTS then run the following query:
If you want to remove ALL APPROVED COMMENTS then run the following query:
If you want to remove ALL TRASH COMMENTS then run the following query:
If you want to remove ALL SPAM COMMENTS then run the following query:
Deleting rows this way leaves their data behind in the wp_commentmeta table. You can clean it up with this query:
The comment counts shown on your posts are not updated by these queries. If you have WP-CLI, you can recount them with
wp comment recount $(wp post list --format=ids).In case your database prefix is not the default one (wp_), replace the wp_ prefix I used with yours.
Need a hand with your WordPress site? Answer four quick questions and see your flat price before you pay. Start here →
Free guide from LeDetailWP
WordPress Cleanup Guide
Declutter your WordPress site, clear out what slows it down and find the free plugins that keep it running smoothly.
Get the free guide →
I highly recommend hiring FixMyWP to fix your website. They are very professional and my issues were resolved within a few hours.
Mass Delete WordPress Comments using a plugin(or two :D)
Using phpMyAdmin for deleting comments from your WordPress site may be too complicated for some of you, so I suggest taking a look at the following WordPress plugins that will do the job nice and easy.
WPCommentCleaner
Delete Pending Comments
Both of these plugins are old and may no longer be available or maintained, so check their WordPress.org pages before you install them. You may not need a plugin at all: in Comments, open the Spam or Trash tab and click Empty Spam or Empty Trash. For pending comments, use Screen Options to show up to 999 comments per page, select them all and choose Move to Trash from the bulk actions.
If you have WP-CLI on your server, this command deletes all spam comments at once:
As always, feel free to comment if you need help or have a question (or even two)!
Need a hand with your WordPress site?
Answer four quick questions and see your flat price before you pay. Most fixes are done the same day or within 24 business hours.
Answer 4 quick questionsSee all prices
In this article
Need a hand with your site?
Answer four quick questions and see your flat price before you pay. Most fixes are done the same day or within 24 business hours.
Related articles
How to Integrate Your Etsy Shop into your WordPress Website and Why You Should
ou’ve sold hundreds to thousands of dollars on Etsy, and now you know it’s time to run your own website. Even if
Speed up your WordPress Site by removing Emojis
What is an Emoji? It’s a small digital image or icon used to express an idea, emotion, etc., in electronic communication. How
Creating Child Themes for Twenty Twenty-Five, Twenty Twenty-Four and Twenty Twenty-Three
In this tutorial I’m going to show you how to create child themes for the newest WordPress default themes: Twenty Twenty-Five, Twenty