{"id":73473,"date":"2017-08-19T10:42:32","date_gmt":"2017-08-19T10:42:32","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/custom-post-type-cleanup\/"},"modified":"2024-04-20T15:01:55","modified_gmt":"2024-04-20T15:01:55","slug":"custom-post-type-cleanup","status":"publish","type":"plugin","link":"https:\/\/ur.wordpress.org\/plugins\/custom-post-type-cleanup\/","author":123474,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.3.2","stable_tag":"1.3.2","tested":"6.5.8","requires":"5.9","requires_php":"","requires_plugins":null,"header_name":"Custom Post Type Cleanup","header_author":"keesiemeijer","header_description":"Detect and delete posts from custom post types that are no longer in use.","assets_banners_color":"6b4331","last_updated":"2024-04-20 15:01:55","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"","rating":5,"author_block_rating":0,"active_installs":1000,"downloads":27707,"num_ratings":35,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":{"1.1.0":{"tag":"1.1.0","author":"keesiemeijer","date":"2017-11-09 14:12:58"},"1.2.0":{"tag":"1.2.0","author":"keesiemeijer","date":"2019-02-21 17:20:31"},"1.3.0":{"tag":"1.3.0","author":"keesiemeijer","date":"2020-08-28 09:48:28"},"1.3.2":{"tag":"1.3.2","author":"keesiemeijer","date":"2024-04-20 15:01:55"}},"upgrade_notice":{"1.3.2":"<p>Tested plugin to WP 6.5 on newer PHP versions<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":35},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":1716282,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":1716282,"resolution":"256x256","location":"assets","locale":""},"icon.svg":{"filename":"icon.svg","revision":1716282,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":1716260,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":1716260,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.1.0","1.2.0","1.3.0","1.3.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":2097580,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":1783884,"resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":1786212,"resolution":"3","location":"assets","locale":""}},"screenshots":{"1":"Plugin page","2":"Plugin page after re-registering unused custom post types.","3":"Plugin page after cleaning up all unused post type posts"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[],"plugin_category":[],"plugin_contributors":[79806],"plugin_business_model":[],"class_list":["post-73473","plugin","type-plugin","status-publish","hentry","plugin_contributors-keesiemeijer","plugin_committers-keesiemeijer"],"banners":{"banner":"https:\/\/ps.w.org\/custom-post-type-cleanup\/assets\/banner-772x250.jpg?rev=1716260","banner_2x":"https:\/\/ps.w.org\/custom-post-type-cleanup\/assets\/banner-1544x500.jpg?rev=1716260","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/custom-post-type-cleanup\/assets\/icon.svg?rev=1716282","icon":"https:\/\/ps.w.org\/custom-post-type-cleanup\/assets\/icon.svg?rev=1716282","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/custom-post-type-cleanup\/assets\/screenshot-1.png?rev=2097580","caption":"Plugin page"},{"src":"https:\/\/ps.w.org\/custom-post-type-cleanup\/assets\/screenshot-2.png?rev=1783884","caption":"Plugin page after re-registering unused custom post types."},{"src":"https:\/\/ps.w.org\/custom-post-type-cleanup\/assets\/screenshot-3.png?rev=1786212","caption":"Plugin page after cleaning up all unused post type posts"}],"raw_content":"<!--section=description-->\n<p>Custom post type posts are left in the database if a post type is no longer registered (in use).<\/p>\n\n<p>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.<\/p>\n\n<p>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.<\/p>\n\n<p>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 &gt; Tools &gt; Custom Post Type Cleanup.<\/p>\n\n<p><strong>Note<\/strong>: The proper WordPress delete function <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_delete_post\/\">wp_delete_post<\/a> 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.<\/p>\n\n<p>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).<\/p>\n\n<!--section=installation-->\n<p>Follow these instructions to install the plugin.<\/p>\n\n<ol>\n<li>In your WordPress admin panel, go to Plugins &gt; New Plugin, search for \"custom post type cleanup\" and click \"Install now\".<\/li>\n<li>Alternatively, download the plugin and upload the contents of custom-post-type-cleanup.zip to your plugins directory, which usually is \/wp-content\/plugins\/.<\/li>\n<li>Activate the plugin<\/li>\n<li>Go to wp-admin &gt; Tools &gt; Custom Post Type Cleanup and see if there are unused custom post type posts in the database.<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.3.2<\/h4>\n\n<ul>\n<li>Tested plugin to WP 6.5 on newer PHP versions.<\/li>\n<\/ul>\n\n<h4>1.3.0<\/h4>\n\n<ul>\n<li>Add batch size option to admin form.<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>Add ability to re-register unused custom post types.<\/li>\n<\/ul>","raw_excerpt":"Detect and delete posts from custom post types that are no longer in use","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/73473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=73473"}],"author":[{"embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/keesiemeijer"}],"wp:attachment":[{"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=73473"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=73473"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=73473"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=73473"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=73473"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=73473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}