How to Delete All Comments in WordPress at Once [4 Methods]

Faruk Sardar
Last updated on September 8, 2026

On this page

Share
how to delete all comments in wordpress

I opened a client’s Comments screen last year and found 41,000 comments waiting in the pending queue. Deleting them 20 at a time was not going to happen. If you’re staring at a similar number right now, this post shows you how to delete all comments in WordPress at once, using four different methods.

You will learn the dashboard method, the WP-CLI method, the direct SQL method, and the plugin method. Everything here works on current WordPress versions, and none of it needs you to edit theme files.

Before you delete anything, read this

Comment deletion is permanent. There is no undo button once the trash is emptied, so take a full database backup first, not just a files backup.

There’s a second trap that bites people later. If you delete comments straight from the database, WordPress still shows the old comment count under every post title, because that number lives in a separate column. I’ll show you the one line that fixes it.

How to delete all comments in WordPress from the dashboard

This is the no code method. It works fine up to a few thousand comments.

For example, you can see:

  1. Go to Comments in your WordPress admin sidebar.
  2. Click Screen Options in the top right corner.
  3. Change Number of items per page to 999 and click Apply.
  4. Tick the checkbox in the table header to select every comment on the page.
  5. Pick Move to Trash from the Bulk actions dropdown and click Apply.
  6. Click the Trash link above the table, then click Empty Trash.

I set the per page value to 999 because that’s the hard maximum WordPress allows in Screen Options. The input has max="999" built in, so typing 5000 won’t help you.

The header checkbox only selects comments on the current page. That’s why step 3 comes before step 4. If you skip it, you’ll delete 20 comments and wonder why the counter barely moved.

Step 6 matters too. Move to Trash doesn’t actually remove anything. The rows stay in your database until you empty the trash, so your table size won’t drop until you do.

How to delete all pending comments in WordPress

Same screen, one extra click. If you only want to clear the moderation queue and keep the real comments, filter first.

For example, you can see:

  1. On the Comments screen, click the Pending tab above the table.
  2. Set Screen Options to 999 again.
  3. Select all, choose Move to Trash, click Apply.
  4. Empty the trash.

The Spam tab works the same way, and it has a shortcut. Click Empty Spam and every spam comment is gone in one click, no bulk action needed.

I use the Pending filter more than anything else. Most of what piles up in that queue is bot traffic, and it never needed a human review in the first place.

How to delete all WordPress comments in one go with WP-CLI

If you have SSH access, this is the fastest and safest way to do it. WP-CLI deletes through WordPress itself, so your comment counts and caches stay correct.

# Check how many comments you actually have first
wp comment count

# Delete every comment, skipping the trash entirely
wp comment delete $(wp comment list --status=all --format=ids) --force

The inner command builds a list of comment IDs and passes them straight into the delete command. The --force flag skips the trash bin, so the rows are removed in one pass instead of two.

I set --status=all on purpose. It pulls approved, pending, spam, and trashed comments together, so you don’t need to run the command four times.

On a big site that ID list can get long enough to break your shell’s argument limit. If the command fails with something like “argument list too long”, chunk it:

# Delete in batches of 500 instead of all at once
wp comment list --status=all --format=ids | xargs -n 500 wp comment delete --force

To clear only the pending queue, swap the status. WP-CLI calls pending comments hold:

wp comment delete $(wp comment list --status=hold --format=ids) --force

You can check the full option list in the WP-CLI comment command docs.

How to delete comments in WordPress all at once with SQL

This is the nuclear option. It’s the fastest method on a site with hundreds of thousands of rows, and it’s the one that leaves the most mess if you get it wrong.

Open phpMyAdmin or your hosting panel’s database tool, select your site’s database, click the SQL tab, and run this:

-- Replace wp_ with your real table prefix
TRUNCATE TABLE wp_comments;
TRUNCATE TABLE wp_commentmeta;

-- This is the line people forget
UPDATE wp_posts SET comment_count = 0;

The first two lines empty the comments table and the comment metadata table. Truncating resets the auto increment counter too, so new comments start at ID 1 again.

The third line is the one that saves you a support ticket. WordPress caches the number of comments per post in wp_posts.comment_count, and a raw delete never touches it. Skip that line and every post will keep claiming it has 87 comments while showing none.

Check your table prefix before you run this. Many installs use something other than wp_, and you’ll find yours in wp-config.php on the $table_prefix line.

If you already ran the truncate and forgot the count reset, WP-CLI can rebuild it for you:

wp comment recount $(wp post list --format=ids)

How to delete all comments in WordPress with a plugin

If SSH and phpMyAdmin both feel like too much, Disable Comments does the job from the admin screen.

For example, you can see:

  1. Install and activate the plugin.
  2. Go to Settings > Disable Comments.
  3. Open the Delete Comments tab.
  4. Choose Everywhere and confirm.

The plugin batches the deletion in the background, so it won’t time out the way a huge bulk action can on shared hosting. It also lets you turn comments off across the whole site at the same time.

I’d deactivate and delete the plugin once the cleanup is finished. There’s no reason to keep code loaded for a job you run once.

How to stop the comments coming back

Deleting is only half the fix. If comments are still open, the spam bots will refill the queue within a week.

Go to Settings > Discussion and untick Allow people to submit comments on new posts. That closes comments on everything you publish from now on, but it does nothing to your existing posts.

For the old posts, use bulk edit:

  1. Go to Posts > All Posts and set Screen Options to 999.
  2. Select all posts, choose Edit from Bulk actions, click Apply.
  3. Set Comments to Do not allow and click Update.

Repeat that on the Pages screen. The WordPress comment settings documentation covers the rest of the options on that screen if you’d rather keep comments but tighten moderation.

Which method I use

I reach for WP-CLI every time I have shell access. It’s a single command, it keeps comment counts accurate without any extra work, and it goes through WordPress hooks, so plugins that store data alongside comments get a chance to clean up after themselves.

I use the dashboard method on sites where I only have a login, and SQL only when the comment table is genuinely huge and WP-CLI is timing out. The plugin route is my pick for handing off to a non technical client, since it’s four clicks and there’s nothing to break.

FAQ

Does deleting comments hurt my SEO?

Comment text is indexable content, so removing thousands of real discussions can shrink what Google sees on a page. Spam and pending bot comments were never indexed as valuable content, so clearing those costs you nothing.

Will deleting all comments delete pingbacks and trackbacks too?

Yes. Pingbacks and trackbacks are stored as rows in the same wp_comments table, so a full delete removes them along with everything else.

Why do my posts still show a comment count after deleting?

Because wp_posts.comment_count is stored separately and a raw SQL delete doesn’t update it. Run the UPDATE wp_posts SET comment_count = 0; query or the wp comment recount command shown above.

Can I recover comments after deleting them?

Only from a database backup. Once the trash is emptied or --force is used, the rows are gone from the database with no recovery path inside WordPress.

Does emptying the trash reduce my database size?

The rows are removed, yes. On InnoDB the file on disk may not shrink right away, so run OPTIMIZE TABLE wp_comments; if you want the space reclaimed immediately.

How many comments can the dashboard handle at once?

999 per page, and in practice a few thousand total before shared hosting starts timing out mid request. Past that, use WP-CLI or SQL.

Wrapping up

That’s four ways to delete all comments in WordPress, from a few clicks in the admin to a single line in your terminal. Pick the one that matches the access you have, take the backup first, and remember the comment count reset if you go the SQL route.

Every method here works on current WordPress releases, and the Comments screen has behaved this way for a long time, so this won’t break on your next update. If you get stuck on any step, drop a comment and I’ll help you work through it. There are more posts like this over on my blog.

Thanks for reading.

Book interior formatting

Send me the brief and the deadline.

typical build: 3–6 weeks, depending on scope and content readiness.