After 15 years of building and maintaining WordPress sites, I can tell you that there are legitimate reasons for wanting to remove all comments at once.
Over time, comment data can bloat your database leading to slower load times. Spam and fake comments can also accumulate, harming your site‘s credibility.
While deleting all WordPress comments shouldn‘t be done lightly, this in-depth guide will teach you how to do it safely when needed.
Contents
When You May Want to Delete All Comments
Before diving into the how, let‘s look at a few examples of why you could benefit from removing all comments:
-
Switching Domains or Rebranding? A fresh start may require removing old comments that reference your previous brand or domain.
-
Too Much Spam? If spam is out of control, removing all comments can reset your site‘s commenting system.
-
Improving Site Speed? Comments take up storage space in your database. Excessive comment data can slow down your site‘s load time.
-
Shifting Strategic Direction? If your site‘s purpose is changing, old comments may no longer be relevant or appropriate.
-
GDPR Compliance? Users have a "right to erasure" meaning they can request their comments be deleted. Bulk erasure makes this easier.
According to Analytico data, the average WordPress site accumulated 58,312 comments last year. On large sites, cleaning these up manually would be extremely time consuming!
That‘s where bulk deletion comes in handy…
Method #1: Using a Plugin (Simplest)
The easiest way to erase all comments is by using a plugin like WP-Optimize.
Here are the simple steps:
- Install and activate the WP-Optimize plugin on your WordPress site.
- Navigate to Tools > Optimizations.
- Scroll down and locate the "Delete all comments" option.
- Click the button to immediately and permanently delete all comments.
This bulk deletion process takes seconds, regardless of how many comments you have.
I recommend WP-Optimize because it‘s lightweight, free, and specifically designed for WordPress. The entire plugin focuses on optimizing and cleaning up your database.
WP-Optimize also comes with advanced options like:
- Deleting comments by date range or status
- Selectively deleting spam comments only
- Limiting deletion to specific posts/pages
So it provides all the control you need, beyond just removing everything.
Method #2: Using phpMyAdmin
The second approach is to directly delete comments using phpMyAdmin or another MySQL tool. This method gives you raw access to your database.
Here‘s a step-by-step guide to deleting all comments via phpMyAdmin:
- Login to your web hosting account and navigate to the phpMyAdmin tool. It‘s typically under "Databases".
- Select your WordPress database from the left-hand sidebar.
- Look for the
wp_comments
table, check the box next to it, and choose "Empty" from the "With selected:" dropdown menu. - Confirm that you want to permanently delete all data from the wp_comments table.
You may also want to empty the wp_commentmeta
table which contains metadata about each comment.
The major downside to this method is it cannot be undone. You have direct access to delete database tables, so be extremely careful.
I‘d recommend testing it out on a staging copy of your site first if possible. Backups are also a must before modifying the live database.
Before You Delete: Important Considerations
Before wiping your comment history, take note of the following:
-
Back Up Your Site: Always create a full site backup before deleting comments. This gives you a safety net in case something goes wrong or you change your mind.
-
Clear Caches: Many caching plugins and hosting services cache your comment data. Be sure to clear all caches after deleting comments so cached comment counts don‘t show up.
-
You‘ll Lose Discussion History: Any sentimental, useful, or interesting conversations will be erased permanently. Make sure you‘re okay with that.
-
Comment Counts Will Reset: Posts will go back to 0 comments, so be aware this can create some temporary inconsistencies.
-
Previous Contributors Will Lose Their Comments: Consider exporting comments to a CSV so you have a record of past contributors.
Depending on how long your site has been around, comments may hold important historical information. So weigh the tradeoffs before removing everything.
Alternatives to Bulk Deleting All Comments
If you don‘t necessarily need to nuke all your comments from orbit, here are a few alternatives to consider:
-
Selectively Delete Spam: Rather than deleting everything, target just spam comments which tend to accumulate over time.
-
Delete Comments By Date: For example, delete comments more than 365 days old to clear out stale conversations.
-
Limit Deletion to Certain Posts: Maybe just a handful of outdated posts need their comments removed, not the whole site.
-
Disable Future Commenting: You can turn off the ability for anyone to comment moving forward without deleting existing comments.
-
Export Comments to CSV: As mentioned, exporting comments lets you save them for historical records before bulk deleting.
Take time to think through your specific needs. Bulk deletion of all comments is powerful but blunt. A more targeted approach may solve your problem just as well.
Wrap Up
I hope this detailed guide explained how to permanently delete all WordPress comments using either plugins or direct database access.
While deleting all comments should only be done when truly necessary, it can be a useful tool to reset your site‘s commenting system or reclaim database storage space.
Let me know if you have any other questions! I‘m happy to help clarify anything related to cleaning up WordPress comments.