WP-Sweep

外掛說明

這個外掛能清理以下項目:

  • 內容修訂
  • 自動儲存的草稿
  • 已刪除的留言
  • 待審閱的留言
  • 垃圾留言
  • 已刪除的留言
  • 不再與任何項目關聯的文章中繼資料
  • 不再與任何項目關聯的留言中繼資料
  • 不再與任何項目關聯的使用者中繼資料
  • 不再與任何項目關聯的分類法詞彙中繼資料
  • 不再與任何項目關聯的分類法詞彙關聯性
  • 不再使用的分類法詞彙
  • 重複的文章中繼資料
  • 重複的留言中繼資料
  • 重複的使用者中繼資料
  • 重複的分類法詞彙中繼資料
  • 選項暫存資料
  • 最佳化資料庫資料表
  • 文章中繼資料中的 oEmbed 快取

這個外掛會盡可能使用適當的 WordPress 刪除功能,而不是直接執行 MySQL 的刪除查詢。

這個外掛會使用以下刪除功能函式:

  • wp_delete_post_revision()
  • wp_delete_post()
  • wp_delete_comment()
  • delete_post_meta()
  • delete_comment_meta()
  • delete_user_meta()
  • delete_term_meta()
  • wp_remove_object_terms()
  • wp_delete_term()
  • delete_transient()
  • delete_site_transient()

WP-Sweep WP REST API 端點
* GET /wp-json/sweep/v1/count/<Name>:取得指定清理項目的數量。
* GET /wp-json/sweep/v1/details/<Name>:取得指定清理項目的詳細資料。
* DELETE /wp-json/sweep/v1/sweep/<Name>:清理指定項目。

WP-Sweep WP-CLI 命令
* wp sweep --all:清理全部項目。
* wp sweep <Name>:清理指定項目。
* wp sweep <Name1> <Name2>:清理多個指定項目。

WP-Sweep 能夠處理以下項目:
* revisions
* auto_drafts
* deleted_posts
* unapproved_comments
* spam_comments
* deleted_comments
* transient_options
* orphan_postmeta
* orphan_commentmeta
* orphan_usermeta
* orphan_termmeta
* orphan_term_relationships
* unused_terms
* duplicated_postmeta
* duplicated_commentmeta
* duplicated_usermeta
* duplicated_termmeta
* optimize_database
* oembed_postmeta

WP-Sweep 與以下外掛不相容:
* Custom Fonts
* Elementor Popup Builder
* MailPress
* Meta Slider
* Polylang
* Slider Revolution
* Viba Portfolio
* WPML

建置狀態


開發工作

致謝名單

贊助開發工作

開發者用了許多時間建立外掛,並加以更新、維護及進行技術支援,如果喜歡這個外掛並贊助幾美元給開發者,開發者會非常感激。沒有贊助亦無妨,這個外掛可供網站隨時使用,不須有任何負擔。

螢幕擷圖

  • WP-Sweep 管理頁面 (清理前)
  • WP-Sweep 管理頁面 (清理後)

安裝方式

  1. 將外掛安裝壓縮檔解壓縮所得的 wp-sweep 資料夾上傳至 /wp-content/plugins/ 目錄。
  2. 在 WordPress 管理後台的 [外掛選單] 中啟用 WP-Sweep
  3. 前往管理後台的 [工具]→[清理資料] 便能使用 WP-Sweep 的功能。

常見問題集

即將推出…

使用者評論

2025 年 3 月 26 日
WP-Sweep is a simple yet powerful plugin that helps keep your WordPress site running smoothly. It cleans up unnecessary data like post revisions, trashed posts, spam comments, unused terms, and more — all using native WordPress functions, which makes it safer than many alternatives. We’ve used WP-Sweep on multiple websites and it’s never caused any issues. It’s lightweight, user-friendly, and does exactly what it promises. The interface is clear and makes it easy to choose what to clean. Highly recommended for anyone looking to optimize their WordPress database without the risk of breaking anything.
2025 年 1 月 22 日
great and simple plugin, no licence shit – it just works, thanks!
閱讀全部 135 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈WP-Sweep〉的開發相關工作。

參與者

〈WP-Sweep〉外掛目前已有 20 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈WP-Sweep〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.1.8

  • FIXED: Added current_user_can() Check For AJAX Calls

1.1.7

  • FIXED: Pass in default blank string to fix fatal error

1.1.6

  • NEW: Re-org wp-sweep.php to inc/class-wpsweep.php
  • NEW: Bump to WordPress 6.2

1.1.5

  • NEW: Bump to WordPress 5.8

1.1.4

  • FIXED: Replaced %_transient_% with %\_transient\_%. Escape _ in MySQL if not it is being used as a wildcard character. Props @janrenn.

1.1.3

  • FIXED: Changed permissions check to activate_plugins because update_plugins will return false when DISALLOW_FILE_MODS=true.

1.1.2

  • NEW: Changed permission check to update_plugins for better MultiSite compatibility.
  • NEW: Bump min PHP version to 5.6.

1.1.1

  • NEW: wp_sweep_excluded_termids filter.

1.1.0

  • NEW: Added WP Rest API Endpoint support, sweep/v1/count/<Name>, sweep/v1/details/<Name>, and sweep/v1/sweep/<Name>
  • FIXED: Follow as close as possible to WordPress Coding Standards

1.0.12

  • NEW: Bump to WordPress 4.9
  • NEW: Update README to incompatible plugins

1.0.10

  • FIXED: Invalid plugin head ‘This plugin has an invalid header.’

1.0.9

  • NEW: Support for Codeclimate
  • FIXES: Uses get_sites() on WordPress 4.6. This should fix deprecated notices.
  • FIXES: Fixes translation placeholder count. Props @pedro-mendonca.
  • FIXES: Use manage_options capability as it conflicts with Admin Menu Editor on multisite installs. Props @EusebiuOprinoiu.

1.0.8

  • NEW: Added wp_sweep_excluded_taxonomies filter to allow more than just link_category taxonomy
  • NEW: Support for WP-CLI wp sweep

1.0.7

  • FIXES: Use custom query to delete Orphaned Term Relationship if wp_remove_object_terms() fails

1.0.6

  • NEW: Delete ‘languages’ folder from the plugin
  • NEW: Use translate.wordpress.org to translate the plugin
  • FIXED: Works only with WordPress 4.4 because of new term meta

1.0.5

  • FIXED: apply_filters() wrong arguments

1.0.4

  • NEW: oEmbed caches in post meta Sweep
  • NEW: Add POT file for translators

1.0.3

  • NEW: AJAX Sweep All
  • NEW: AJAX Sweeping
  • NEW: View details of sweep
  • NEW: Optimize DB sweep
  • NEW: User hint and confirmation. Props @SiamKreative
  • FIXED: Division by zero. Pros @barisunver

1.0.2

  • FIXED: Use term_id for wp_remove_object_terms()
  • FIXED: number_format_i18n() issues after sweeping

1.0.1

  • NEW: Moved plugin location to WP-Admin -> Tools -> Sweep
  • NEW: Add Deleted Post Sweep
  • FIXED: Use forced_delete for wp_delete_post() and wp_delete_comment();
  • FIXED: If orphaned meta has an object id of 0, use SQL query to delete

1.0.0

  • Initial release