How to delete all comments on WordPress manually

Managing comments on a WordPress site can be a straightforward task when dealing with a few entries, but when the volume scales—especially with spam or outdated comments—it becomes necessary to do a clean-up. While plugins are available to automate this process, not everyone prefers adding additional software to a website. Many site owners, developers, and administrators seek to delete all WordPress comments manually for better control, security, and performance. This guide explores various manual methods to delete all comments from a WordPress website without using plugins.

Why Delete All Comments?

There are several reasons someone may want to remove all comments from their WordPress site:

  • Spam Overload: Excessive spam comments can clutter the dashboard and database.
  • Content Clean-Up: Site redesign or repurposing might require a fresh comment slate.
  • Performance: Large volumes of comments can affect site speed and database performance.
  • Security: Malicious links or content in old comments might pose risks.

Manual Methods for Deleting All WordPress Comments

There are a few ways comments can be manually deleted in WordPress. Below are the most effective methods categorized by user skill level.

1. Using the WordPress Admin Dashboard

For those who prefer a user interface and have a moderate number of comments, the WordPress dashboard method is viable:

  1. Log in to your WordPress admin area.
  2. Navigate to Comments from the sidebar menu.
  3. Select the checkbox at the top of the comment list to select all visible comments.
  4. Choose “Move to Trash” from the Bulk Actions dropdown.
  5. Click “Apply”.
  6. Repeat this process for all pages of comments.

This method is time-consuming for sites with thousands of comments and doesn’t permanently delete them. You’ll need to empty the trash afterward.

2. Deleting Comments via phpMyAdmin

For users comfortable accessing their website’s database, phpMyAdmin offers a direct and efficient method for deleting all comments:

  1. Log in to your hosting control panel (such as cPanel).
  2. Open phpMyAdmin.
  3. Select your WordPress database from the sidebar.
  4. Find the table named wp_comments.
  5. Click the “Empty” link next to the table name.
  6. Confirm the deletion.

This removes all rows from the comments table, effectively deleting all comments at once. Be cautious—this action is irreversible.

3. Using SQL Queries to Delete All Comments

If you’re technically inclined and wish to take more targeted action, running SQL queries in phpMyAdmin or another database tool can help:

DELETE FROM wp_comments;

However, it’s also important to delete comment metadata which is stored in a separate table:

DELETE FROM wp_commentmeta;

These two queries will completely purge all information related to comments from the database. Always back up your database before executing queries.

4. Deleting Comments via WP-CLI

For developers or those comfortable with the command line, WP-CLI (WordPress Command Line Interface) provides an efficient method:

  1. Connect to your site via SSH.
  2. Ensure WP-CLI is installed and accessible.
  3. Navigate to the root of your WordPress installation.
  4. Run the following command:
wp comment delete $(wp comment list --format=ids) --force

This command fetches all comment IDs and deletes them forcefully. It’s fast, reliable, and excellent for large-scale sites.

5. Disabling Comments Entirely

You may not only want to remove existing comments, but also prevent any future ones. Follow these steps within the WordPress dashboard:

  1. Go to Settings > Discussion.
  2. Uncheck “Allow people to submit comments on new posts.”
  3. Click “Save Changes”.

For already published posts, you can bulk edit posts from the Posts area to disable comments retroactively.

Precautions Before Deleting Comments

  • Back Up Your Site: Always create a full backup of your website and database.
  • Test in a Staging Environment: Try deleting comments in a test version of your site before applying changes to live systems.
  • Check Database Prefixes: If you’ve changed the database table prefix from wp_, make sure to adjust SQL queries accordingly.

Benefits of Manual Comment Deletion

Manually deleting comments—especially through phpMyAdmin or WP-CLI—has several advantages:

  • No dependency on plugins
  • Cleaner and faster comment removal
  • Avoids compatibility issues with plugin updates

Post-Deletion Maintenance

Once all comments have been removed, consider these maintenance tasks:

  • Clear any cached pages or database entries using a caching plugin or through your host.
  • Optimize your database to reclaim unused space (can be done via phpMyAdmin or WP-CLI).
  • Review user roles and permissions to reduce spam risks in future.

Conclusion

Whether you’re spring-cleaning your WordPress site or preparing for a redesign, deleting all comments manually gives you more control and avoids unnecessary plugin bloat. From using the built-in dashboard options to WP-CLI and database-level deletions, each method offers a solution tailored to different skill levels and requirements.

Frequently Asked Questions (FAQ)

Can I recover deleted comments?
No, once comments have been permanently deleted (not just trashed), they cannot be recovered unless you have a backup.
Will deleting comments affect my SEO?
Possibly. If comments contain valuable content or keywords, deleting them might reduce page relevance. However, removing spam or irrelevant comments often improves content quality.
Is it safe to delete from the database directly?
Yes, but with precautions. Always back up your site beforehand and make sure you understand the impact of the actions being taken.
Why not use a plugin to delete comments?
Some users prefer manual methods to avoid plugin overhead, potential conflicts, or for more precise control over their site’s data.
What happens to comment authors after deletion?
Their data in the comments table is removed. However, registered user accounts remain intact if the users were site members.
How can I prevent comments in the future?
Disable comments from WordPress settings and use the “Discussion” options to block new submissions. Additionally, consider disabling comment fields from theme templates.

Leave a Reply

Your email address will not be published.

*