Custom Post Type Cleanup

plugin banner

Detect and delete posts from custom post types that are no longer in use

Author:keesiemeijer (profile at wordpress.org)
WordPress version required:4.2
WordPress version tested:5.5.3
Plugin version:1.3.0
Added to WordPress repository:19-08-2017
Last updated:28-08-2020
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:100
Rated by:30
Plugin URI:
Total downloads:21 469
Active installs:1 000+
plugin download
Click to start download

Custom post type posts are left in the database if a post type is no longer registered (in use).

Plugins and themes can (without you knowing) use custom post types as a way to store data. These posts stay in the database forever if they’re not cleaned up by the plugin/theme itself upon deletion.

There are a lot of plugins that clean your database (by removing revisions, drafts etc.), but I haven’t found one that does a cleanup of unused post type posts.

This plugin provides an easy way to detect and remove posts from post types that are no longer in use. The settings page for this plugin is at wp-admin > Tools > Custom Post Type Cleanup.

Note: The proper WordPress delete function wp_delete_post is used instead of running a direct MySQL query to delete the posts. This way all associated post data (comments, post meta etc.) are also deleted from the database.

Since version 1.2.0 you can re-register unused custom post types for a limited period of time. This allows you to inspect and delete the posts like you would normally (in the wp-admin).


Screenshots
ChangeLog