Plugin info

Total downloads: 26,938
Active installs: 1,000
Total reviews: 35
Average rating: 5
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 2 language(s)
Contributors: 1
Last updated: 4/20/2024 (668 days ago)
Added to WordPress: 8/19/2017 (8 years old)
Minimum WordPress version: 5.9
Tested up to WordPress version: 6.5.7
Minimum PHP version: f

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 668 days ago • 35 reviews

32/100

Is Custom Post Type Cleanup abandoned?

Possibly abandoned (last update 668 days ago).

Compatibility

Requires WordPress: 5.9
Tested up to: 6.5.7
Requires PHP: f

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

No similar plugins found yet.

Description

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).

Installation

Follow these instructions to install the plugin.

  1. In your WordPress admin panel, go to Plugins > New Plugin, search for “custom post type cleanup” and click “Install now”.
  2. Alternatively, download the plugin and upload the contents of custom-post-type-cleanup.zip to your plugins directory, which usually is /wp-content/plugins/.
  3. Activate the plugin
  4. Go to wp-admin > Tools > Custom Post Type Cleanup and see if there are unused custom post type posts in the database.

Frequently Asked Questions

No FAQ available

Review feed

Slava Abakumov
11/29/2024

I'm glad someone created this plugin

So I didn't have to :) Awesome little handy tool to clean up old sites from obsolete CPTs and their post meta. I wish it also supported custom taxonomies that were registered for those obsolete CPTs.

Screenshots

  1. Plugin page

    Plugin page

  2. Plugin page after re-registering unused custom post types.

    Plugin page after re-registering unused custom post types.

  3. Plugin page after cleaning up all unused post type posts

    Plugin page after cleaning up all unused post type posts

Changelog

1.3.2

  • Tested plugin to WP 6.5 on newer PHP versions.

1.3.0

  • Add batch size option to admin form.

1.2.0

  • Add ability to re-register unused custom post types.