[WordPress] 外掛分享: Custom Post Type Cleanup

首頁外掛目錄 › Custom Post Type Cleanup
WordPress 外掛 Custom Post Type Cleanup 的封面圖片
1,000+
安裝啟用
★★★★★
5/5 分(35 則評價)
722 天前
最後更新
問題解決
WordPress 5.9+ v1.3.2 上架:2017-08-18

內容簡介

如果某個文章型態(post type)不再被註冊使用,其相關的文章將會留在資料庫中。

有些外掛和佈景主題可能會使用自定的文章型態來儲存資料,如果這些文章沒有在刪除時由外掛或佈景主題自行清理,則它們會永遠留在資料庫中。

雖然有很多外掛可以清理資料庫(例如刪除修訂版本、草稿等),但我們尚未找到一款可以清理未使用文章型態文章的外掛。

這款外掛提供了一種簡單的檢測和刪除不再使用文章型態之文章的方法,其設定頁位於 wp-admin > 工具 > 自訂文章型態清理。

請注意:本外掛會使用正確的 WordPress 刪除功能 wp_delete_post,而不是直接運行 MySQL 查詢以刪除文章,這樣可以同時從資料庫中一併刪除所有相關的文章資料(如評論、文章元數據等)。

從版本 1.2.0 開始,您可以在有限的時間內重新註冊未使用的自訂文章型態。這樣您就可以像通常一樣在 wp-admin 中檢視和刪除這些文章。

開發者團隊

⬇ 下載最新版 (v1.3.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Custom Post Type Cleanup」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

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

延伸相關外掛

文章
Filter
Apply Filters
Mastodon