It’s never an easy decision to make, but there may come a time when you’ve decided to completely clear all the comments on your WordPress site.
The problem is, the default way of doing so is very clunky and slow, and – if your site has been filled with hundreds or even thousands of unwanted comments – it might as well be entirely impossible.
Check Out Our Video Guide to Deleting All Comments From WordPress
If you’re stuck in this unfortunate situation or are just looking for a more efficient way to remove comments in WordPress, you’ve come to the right place. Let’s go over how to delete comments normally, with plugins, and by modifying the database.
Why Delete All Comments in WordPress?
There are many reasons why you might want to delete all your comments, and some of them can be pretty stressful.
- You’re starting from a blank slate or maybe even repurposing your entire site.
- You want to remove commenting as a feature and delete any past comments as well.
- Your test site is full of dummy comments that need to be removed before it goes live.
- Your site is full of spam comments, and anti-spam plugins like Akismet aren’t picking them up properly. (Before deleting everything, try alternate plugins like CleanTalk or Antispam Bee.)
- Your site has been targeted by a hate campaign or something similar and is full of hundreds of hateful comments.
With some of these issues, you should take additional steps after you’ve deleted all comments. If spam brought down your site, implement protections to keep bots out, such as by adding a CAPTCHA field or using a different comment plugin.
If your site was targeted by hateful comments, you may wish to try the Auto Comment Moderation plugin to detect toxic speech. You should also blacklist commenters by viewing their IP in the Comments tab, then adding it to the Comment Blacklist in Settings > Discussion.
And of course, you can simply close comments permanently with the Disable Comments plugin if you don’t want to deal with them anymore.
Preparing To Delete All Comments
It can be tempting to jump right in and get rid of your comments as soon as possible. For instance, spammy links can destroy your SEO, so most people want to take care of an influx of spam comments promptly.
But before you delete anything, you should always make a backup of your website and/or database – especially if you’re using an advanced method, like directly editing the database.
Databases can be pretty sensitive, so you could break your site by accident. A backup in storage will make this an easy fix rather than a nightmare scenario. You may also regret losing your legitimate comments and decide you want to restore a backup or restore your database.
In any case, it’s best practice to always backup your site before majorly editing it like this.
Option 1: Make a Backup of Your WordPress Database
WordPress comments are stored in the database entries “wp_comments” and “wp_commentmeta” rather than in your site files. Rather than backing up your entire website, you can simply export the database.
Most web hosts, including Kinsta, use phpMyAdmin and already have it installed. If you’re not using Kinsta, you can usually access phpMyAdmin through cPanel; ask your host how to do this and what your login credentials are.
If you’re using Kinsta, you can access phpMyAdmin by logging into MyKinsta, navigating to Sites > Info, and clicking Open phpMyAdmin under the Database section. You can find your login credentials here too.
Either way, once you’ve logged into phpMyAdmin, you should see an Export button in the tabs at the tap. Just use the Quick export method and click Go to download the SQL file.
You can also create a normal Kinsta backup as outlined below and save the .sql file you can find in the provided folder.
Option 2: Make a Backup of Your Entire WordPress Site
While not entirely necessary in this situation, it’s never a bad idea to have an external backup of your site. Just make sure you’re creating a full backup, including the database, and not just a backup of your site files. Your backup folder should include a .sql file containing your database.
Kinsta users can easily create a backup of their website. Just log in to MyKinsta and navigate to Sites > Backups. Head to the Download tab and click Create backup now. When the process finishes, click Download backup.
If you’re not using Kinsta, your hosting plan may allow you to create manual backups through their interface. If not, you’ll have to try a plugin.
You can use any backup plugin you want, but one of the most popular free options is UpdraftPlus. Download it through Plugins > Add New, then find the new menu in Settings > UpdraftPlus Backups.
Backing up is very simple; in the Backup/Restore tab, just click the blue Backup Now button. Make sure to check Include your database in the backup. You can uncheck Include your files in the backup if you wish.
Now scroll down to Existing backups to see the backup you just made. Under the Backup data (Click to download)section, click the buttons to save the files to your computer.
With this, your website and database are safe, and you’re ready to delete your WordPress comments for good.
How To Delete All Comments in WordPress: 4 Different Methods
If you want to eliminate all WordPress comments, there are a few different ways to do so.
You can remove comments using WordPress’ default tools, but it’s not the most efficient option. Plugins exist that will remove all comments in one click, and this is the simplest way. If neither of these work, you can access the database directly, but it can be confusing if you’ve never done it before.
We’ll show you how to do all of these now so you can pick the option that works best for you.
Using the WordPress Admin Dashboard
Deleting WordPress comments doesn’t require a plugin or database access; the functionality is built in right there. It can be a bit clunky if you’re unfamiliar with the interface, but otherwise, it works just like bulk editing posts or pages.
In your WordPress dashboard, navigate to Comments. Click the checkbox at the very top of the comments table to select them all. Then look for the Bulk actions dropdown and click Move to Trash. Click Apply.
This will only affect up to 20 comments simultaneously, so you’ll need to repeat this several times to get rid of them all.
WordPress will usually clear the trash after 30 days, but if you want to delete all the comments permanently right now, go to the Trash tab (below the Comments heading) and click the Empty Trash button.
The only issue with this method is when you’re handling a bulk of comments in the hundreds or thousands. If you only need to handle a few pages of them, this method will work fine.
But if the number of comments you have to delete is truly staggering, then a plugin may be more suited to your needs.
Using a Plugin
Plugins can instantly and easily delete a mass amount of comments without having to go through them manually, page by page. This is usually the best choice for clearing your comments and starting from scratch.
There are many plugins that can help you clear out your comments. The first is WP Bulk Delete.
This plugin is made to help you bulk delete any items, from posts to taxonomy terms, but we’ll show you how to use it to delete all comments.
Install and activate it through Plugins > Add New, then find the new WP Bulk Delete option in the sidebar. Navigate to WP Bulk Delete > Delete Comments, then set up the deletion process.
Check all the relevant boxes in Comment Status, especially Approved Comments. If this influx of unwanted comments came suddenly, you can also set it up in the Comment Date section to delete comments from within a certain time period or after a certain date. That way you can preserve your older, legitimate comments! Otherwise, leave this setting alone to clear them all.
Once you’re ready, click Delete Comments. When the process finishes running, you won’t have to deal with this issue anymore.
Another plugin you can try is Delete All Comments of WordPress. This one is pretty simple and to the point; it’s a one-click way to remove every single comment off your website (or all comments in a certain category) with no freemium features. Setup is instant and easy.
Just install the plugin, then find it under Tools > Delete Comments. Select All Comments, then click Delete Now.
That’s all. Whichever plugin you pick, the process shouldn’t take more than a few minutes to fix.
Using phpMyAdmin
If WordPress’ built-in way of bulk deletion isn’t cutting it, but you don’t want to use a plugin or the plugins aren’t working properly – for example, if you have so many comments that trying to delete them all at once is locking up your site – then the next best solution is direct database access.
This option is more advanced and not recommended for beginners and should definitely be preceded by a database backup. But if you’re careful and have a backup, it’s safe and efficient.
First, determine if your web host allows database access, what platform they use, and what your login credentials are. Not all hosts give access to the database; in that case, you’ll have to use a different method.
Most hosts use cPanel, which you can use to access phpMyAdmin from the Databases section. Kinsta users can directly log in to phpMyAdmin through the MyKinsta dashboard. Go to Sites > Info, then in the Database section, click Open phpMyAdmin.
On the left, you’ll see a few database tables. Open the one named after your site, then look for wp_comments and wp_commentmeta in the list. (If your table prefix is different, these names may not start with “wp_”; just look for the comments and commentmeta tables.)
Tick the boxes to select these tables, then at the bottom of the screen, click the With Selected: dropdown and change it to Empty. (Remember to empty, not drop, as dropping will delete the table.)
This will clear all the data in these tables, effectively removing all your comments from WordPress permanently.
Using MySQL Queries (Direct Database Access)
This option is the most difficult for beginners, but for those who prefer the command line over a visual interface or can’t get phpMyAdmin working, it’s the simplest way.
You’ll need the ability to connect to your host via the command line, which not all web hosts allow. For example, Kinsta users can use the MySQL Workbench tool to connect to their website’s MySQL database.
Ask your host what your options are. They’ll also provide you with the username, password, and connection port you’ll need to gain access.
Direct database access can be done with the Terminal built into macOS and Linux. Some Windows users can use the Windows Terminal, while others may need to use a third-party tool. All operating systems can use a tool like MySQL Workbench.
Once you’ve put in your connection info, whether through the Terminal (possibly after installing the MySQL shell) or an external tool, you should be able to simply run the following commands:
TRUNCATE `wp_commentmeta`;
TRUNCATE `wp_comments`;
After running this, it will be equivalent to having logged into phpMyAdmin and emptied those tables. All your comments should be deleted, giving you a fresh start.
Summary
Deleting all comments in WordPress can be a surprisingly frustrating process. WordPress’ built-in bulk editing tool definitely doesn’t cut it when you’ve been inundated with thousands of unwanted comments.
If you’ve found yourself in this unfortunate situation, give a bulk comment deletion plugin a try, then move on to emptying the comment tables in phpMyAdmin if that doesn’t work. As a last resort, you can always use the command line to access your database.
In the future, plugins to keep spam bots out of your comments section or auto-delete unwanted messages can prevent this from happening again. But you can always disable comments for good.
If you ever end up in this situation, remember that Kinsta hosting offers direct database access for all plans. If you’ve ever had a host that cuts off access to your site’s back end, you know how frustrating it can be. Kinsta gives you full control over your site.