How to delete all comments in WordPress quickly and safely

S
Secuirty Team

10 min read

How to delete all comments in WordPress quickly and safely

When a WordPress website starts to accumulate excessive spam comments, outdated discussions that no longer add value, or simply too many comments that make the admin dashboard sluggish, the need to delete all comments in WordPress becomes essential. Instead of handling each comment manually, you may require a faster and safer approach that does not compromise your website’s important data. 

In this article, we will explore how to delete all comments in WordPress quickly and safely using practical methods that are easy to follow, even if you do not have strong technical expertise. Let’s get started!

Why you might need to delete all comments in WordPressLink to heading

Why you might need to delete all comments in WordPress

While comments can play a role in building engagement with your audience, there are situations where removing them from your WordPress site becomes necessary. This is especially true when dealing with spam, a common issue for websites that lack proper anti-spam protection. In such cases, many site owners choose to delete all comments in WordPress instead of managing them one by one.

Spam and low-quality comments can negatively affect user experience and weaken your WordPress SEO performance. In addition, they may introduce security risks, as some comments contain harmful links or redirect visitors to unsafe websites.

>>> Learn more: Akismet Anti-Spam: Is it enough for WordPress security?

Important things to do before deleting commentsLink to heading

Before you delete all comments in WordPress, it’s worth taking a few precautionary steps to avoid unnecessary risks. Removing comments is often irreversible, so a bit of preparation can save you from data loss or unexpected issues.

First, make sure you create a full backup of your website, especially the database. Since comments are stored in the database, deleting them means they are permanently removed. If anything goes wrong, a backup allows you to restore your site to its previous state without losing important content.

Next, understand exactly what you’re deleting. Comments may include valuable user feedback, discussions, or even SEO-relevant content. If your site relies on user interaction, removing everything at once could impact credibility or engagement. Take a moment to review whether you truly need to delete all comments in WordPress or just specific types like spam or pending comments.

You should also decide whether deleting comments is enough, or if you need to disable them entirely. If spam is the main issue, removing comments without applying preventive measures will only lead to the same problem again. In that case, consider turning off comments on certain posts or implementing stricter moderation rules.

Finally, check your tools and permissions. Make sure you have proper access to your WordPress dashboard, hosting control panel, or database management system like phpMyAdmin. This ensures the process goes smoothly, especially if you plan to use advanced methods.

How to delete all comments in WordPressLink to heading

How to delete all comments in WordPress

Use the WordPress admin dashboardLink to heading

The easiest way to remove all comments is directly from your admin dashboard. Start by logging into your site and going to the Comments section. From there:

  1. Click Comments in the left-hand menu.
  2. Open the Bulk Actions dropdown, select Move to Trash, then choose all comments and click Apply.

Use a WordPress pluginLink to heading

You can also use a plugin designed to handle bulk comment removal more efficiently. One popular choice is WP Bulk Delete, which allows you to apply filters and conditions based on your needs.

The free version includes a basic feature to remove comments, while the Pro version offers more advanced filtering options.

To delete comments using WP Bulk Delete:

  • Go to your WordPress dashboard and navigate to WP Bulk Delete → Delete Comments.
  • Select the filters you want, then click Delete Comments. The free version allows filtering based on comment status and publication date. 

Use phpMyAdminLink to heading

Another way to delete all comments in WordPress is by removing them directly from the database through phpMyAdmin. This is worth considering when the admin dashboard or a plugin is not working as expected. However, this method does require a basic understanding of databases and SQL.

You can delete comments in phpMyAdmin in two ways: by running an SQL query or by emptying the comment table. Both methods affect the two tables where comments are stored: wp_comments and wp_commentmeta.

Important: The table names may be different depending on your database prefix.

You can access your database from your web hosting control panel.

Using SQL CommandsLink to heading

Using SQL Commands

If you want to delete all comments in WordPress or remove only a specific group of comments, you can also do it in phpMyAdmin by running SQL commands directly. This is basically the same process a plugin uses, but here you are doing it yourself.

Because this method works at the database level, it carries more risk. If you enter the wrong query, you may delete data you did not mean to remove.

To run a command on a table:

  1. Click the wp_comments table in the list on the left.
  2. Select the SQL tab at the top of the page.
  3. In the Run SQL query/queries on table field, paste one of the commands below.
  4. If you are not sure, click Simulate Query first to see how many rows will be affected.
  5. When everything looks correct, click Go.

Delete spam comments

DELETE FROM wp_comments WHERE comment_approved = 'spam';

Delete pending comments

DELETE from wp_comments WHERE comment_approved =  '0'

Delete approved comments

DELETE from wp_comments WHERE comment_approved =  '1'

Delete comments in the trash

DELETE from wp_comments WHERE comment_approved =  'trash'

Delete only comments, not order notes or other comment types

DELETE from wp_comments WHERE comment_approved =  '1' AND comment_type = 'comment'

ConclusionLink to heading

Knowing how to delete all comments in WordPress quickly and safely gives you full control over your website’s content and maintenance. Whether you choose a simple solution in the admin dashboard or a more advanced approach through phpMyAdmin, the key is to balance speed with safety.

To enhance your website’s security after cleaning up comments, you can install W7SFW (WordPress Firewall). This is a simple yet effective firewall solution that helps block unauthorized access and common attacks from the outset. Its key advantage lies in the quick setup process and user-friendly interface, meaning even those without strong technical knowledge can easily configure it and protect their website.

Related posts

Get In Touch
with our security experts.
Whether you need a custom enterprise plan or technical support, we are here to help. Expect a response within 24 hours.