Use the code PERFMATTERS for 10% off!

How to delete posts and comments in the trash on your WordPress site

Over time the trash can build up on your WordPress site. You are most likely continuously sending old posts and marking low-quality comments as trash. Just like on your computer, the trash bin (a portion of your WordPress site’s database in this case) will keep growing bigger and bigger until you empty it.

WordPress posts in trash
WordPress posts in trash

Delete posts in the trash

Follow the steps below on how to delete posts in the trash on your WordPress site. This includes posts, pages, and custom post types.

Important: These functions make permanent changes that cannot be reverted! Back up your database before proceeding.

Step 1

Click into the Perfmatters plugin settings.

Perfmatters plugin settings
Perfmatters plugin settings

Step 2

Click the “Extras” tab and then click “Database.”

Perfmatters Database
Perfmatters Database

Step 3

Scroll down and toggle on “Trashed Posts.” The number of posts found in the trash will show up to the right of it.

WordPress Trashed Posts
WordPress Trashed Posts

Step 4

Scroll down and click “Optimize Now.”

Perfmatters Optimize Now
Perfmatters Optimize Now

The process will run in the background. You don’t need to stay in the plugin while it’s running or worry about leaving the window open.

Perfmatters database optimization running
Perfmatters database optimization running

It will and let you when it’s finished with a notification at the top of the Perfmatters plugin settings.

Perfmatters database optimization complete
Perfmatters database optimization complete

Delete comments in the trash

Follow the steps below on how to delete comments in the trash on your WordPress site. This includes comments made anywhere on your site that have been marked as trash, including posts, pages, and custom post types.

Important: These functions make permanent changes that cannot be reverted! Back up your database before proceeding.

Step 1

Click into the Perfmatters plugin settings.

Perfmatters plugin settings
Perfmatters plugin settings

Step 2

Click the “Extras” tab and then click “Database.”

Perfmatters Database
Perfmatters Database

Step 3

Scroll down and toggle on “Trashed Comments.” The number of comments found in the trash will show up to the right of it.

WordPress Trashed Comments
WordPress Trashed Comments

Step 4

Scroll down and click “Optimize Now.”

Perfmatters Optimize Now
Perfmatters Optimize Now

The process will run in the background. You don’t need to stay in the plugin while it’s running or worry about leaving the window open.

Perfmatters database optimization running
Perfmatters database optimization running

It will and let you when it’s finished with a notification at the top of the Perfmatters plugin settings.

Perfmatters database optimization complete
Perfmatters database optimization complete

Check out our documentation on WordPress database optimization for other easy ways to clean up your database with Perfmatters. You can also delete posts and comments in the trash on an automated schedule.

Was this article helpful?

Related Articles