SweepPress: Website Cleanup and Optimization

Description

SweepPress is an easy-to-use WordPress plugin built around 42 different Sweepers for database cleanup (the Pro version has 45), support for WP-CLI, and WP REST API to perform the cleanup operations. The plugin also features a powerful WordPress Options database table management panel.

Options Management

The WordPress Options database table holds settings for WordPress Core, all the plugins, and themes. This table can grow significantly, especially since records are not auto-deleted when removing a plugin or theme. SweepPress has Sweepers that deal with transient cache records (stored in this table), and now, since version 3.0, it has a full Management panel where you can see all the records in the Options table, detect source for the record and status to help you decide if you should delete the record or not.

SweepPress has two methods to detect the source of the record, and it will mark all the recognized records. This panel doesn’t show transient records (used for cache) or WordPress options (deleting these options is a terrible idea).

SweepPress Pro has a special monitoring process to obtain very precise information about which Options record is used. It also has advanced management panels for all the WordPress metadata and multisite Sitemeta database tables.

Options deletion process is not automatic! No matter how precise options usage detection is, you need to verify and confirm that you want to delete one or more records.

Modes of Sweeping

  • Auto Sweep: available on the dashboard, running many (not all) sweepers without user input.
  • Quick Sweep: available on the dashboard, allowing the sweepers to be selected.
  • Full Sweep: available on its panel, with detailed information about sweepers and no limit run.
  • CLI Sweep: the plugin supports WP-CLI and adds commands to run all the sweepers with the command line.
  • REST API Sweep: the plugin supports WP REST API and allows sweeping via the new REST endpoints.

All sweepers use optimized SQL queries to find the data for removal, which is also done using SQL queries. This is the fastest and most efficient way to remove a large amount of data quickly.

Quick Video Overview

List of Sweepers

  • Posts: Auto Drafts
  • Posts: Spam Content
  • Posts: Trashed Content
  • Posts: Posts Revisions
  • Posts: Posts Orphaned Revisions
  • Posts: Draft Posts Revisions (v2.1)
  • Posts: Postmeta Locks
  • Posts: Postmeta Last Edits
  • Posts: Postmeta Oembeds
  • Posts: Postmeta Old Data (v2.1)
  • Posts: Postmeta Orphans
  • Comments: Spam Comments
  • Comments: Trashed Comments
  • Comments: Unapproved Comments
  • Comments: Orphaned Comments
  • Comments: Comments User Agents
  • Comments: Commentmeta Orphans
  • Comments: Pingbacks Cleanup
  • Comments: Trackbacks Cleanup
  • Comments: Akismet Meta Records (v1.1)
  • Terms: Terms Orphans
  • Terms: Termmeta Orphans
  • Users: Usermeta Orphans
  • Options: Expired Transients
  • Options: RSS Feeds
  • Options: All Transients
  • Options: CRON Jobs
  • Options: Unhooked CRON Jobs (v2.4)
  • Network: Expired Transients
  • Network: All Transients
  • Network: Inactive Signups (v2.0)
  • Database: Optimize Database Tables
  • Database: Repair Database Tables (v1.6)
  • ActionScheduler: Log Entries (v2.2)
  • ActionScheduler: Orphaned Log Entries (v2.2)
  • ActionScheduler: Failed Actions (v2.2)
  • ActionScheduler: Completed Actions (v2.2)
  • ActionScheduler: Canceled Actions (v2.2)
  • BuddyPress: Activity Meta Orphans (v2.4)
  • BuddyPress: Groups Meta Orphans (v2.4)
  • BuddyPress: Messages Meta Orphans (v2.4)
  • BuddyPress: Notifications Meta Orphans (v2.4)

WP-CLI and WP REST API Support

The plugin registers new CLI commands for running sweep operations from the command line (WP-CLI is required). It also registers the REST API endpoint for the same purpose: running remote sweep operations (only for the administrator role!). CLI and REST API support can be enabled through plugin settings.

Action Scheduler Support

The plugin can clean up the ActionScheduler tables. These tables are used by the Action Schedule plugin and components developed for WooCommerce but also in many other WordPress plugins, including WP Rocket and Rank Math. For these sweepers to be visible, at least one plugin using those tables needs to be active.

Special Notice

The plugin will show the backup reminder notice by default (and it can be disabled) on every page. It is essential to understand that once the plugin deletes data, it can’t be restored. So, if you change your mind later, it is important to make the backup before the data removal. The sweepPress plugin is not responsible for any data loss — ensure backups!

Plugin Home Page

SweepPress Pro

SweepPress Lite edition, available on WordPress.org, is a fully functional plugin with no limits to its operations. But SweepPress Pro contains a lot of additional features not available in the Lite version:

  • Management for ALL the WordPress Metadata tables: supports postmeta, termmeta, commentmeta, usermeta and blogmeta.
  • Management for the WordPress Multisite Sitemeta table: this table is equivalent of the Options table, but for all the blogs in the multisite.
  • Create and manage Sweeper Jobs: create custom background sweeper jobs to run at a specific date or as a recurring job.
  • Control and track WordPress CRON jobs: list all the WordPress CRON jobs, track and display the source, and more.
  • Sweeper Monitor: monitor the website for cleanup daily or weekly, and send notifications when the sweeping limit is reached.
  • Database Tables: an overview of all tables in the database with source information and various actions for better control.
  • Sweeper File Log: log every sweeper execution into a log file with all sweeper/removal SQL queries executed by each used sweeper.
  • GravityForms Support: three additional sweepers to remove all trashed forms, spammed, and trash entries by form.
  • CLI Command to list CRON jobs: list all registered WP CRON jobs via the command line

Future updates will include more exclusive Pro features. Upgrade to SweepPress Pro.

Screenshots

  • Main plugin dashboard with status
  • Quick Sweep Panel available on dashboard
  • Part of the main Sweep panel
  • Few more sweepers on the Sweep panel
  • WordPress Options Management
  • List of all sweepers with scope and availability
  • Settings to enable WP-CLI and REST API support
  • List of sweepers via CLI command

Installation

General Requirements

  • PHP: 7.4 or newer

PHP Notice

  • The plugin doesn’t work with PHP 7.3 or older versions.

WordPress Requirements

  • WordPress: 5.8 or newer

Basic Installation

  • Plugin folder in the WordPress plugins should be sweeppress.
  • Upload the sweeppress folder to the /wp-content/plugins/ directory.
  • Activate the plugin through the ‘Plugins’ menu in WordPress.
  • Plugin adds a new top-level menu called ‘SweepPress.’
  • Check all the plugin settings before using the plugin.

FAQ

Where can I configure the plugin?

The plugin adds a top-level ‘SweepPress’ panel in the WordPress Admin menu.

Can this plugin remove obsolete options from the WordPress Options database table?

SweepPress has a dedicated Options management panel where you can see all the non-WordPress options. The plugin will attempt to detect the source for each option and show its status to help you decide whether to delete some options in that table.

Reviews

November 19, 2022
Wow! This cleans so good!! So, of course 5 stars!!!
March 16, 2022
A very useful plugin, especially on somewhat old installations that have experienced many installations/uninstallations of plugins. Fast and efficient Excellent!! I recommend. 🙂
Read all 3 reviews

Contributors & Developers

“SweepPress: Website Cleanup and Optimization” is open source software. The following people have contributed to this plugin.

Contributors

“SweepPress: Website Cleanup and Optimization” has been translated into 1 locale. Thank you to the translators for their contributions.

Translate “SweepPress: Website Cleanup and Optimization” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

3.0 (2024.04.22)

  • New: codebase based on the SweepPress Pro 5.0
  • New: objects to handle WordPress Options and Sitemeta entries
  • New: panel for managing WordPress Options
  • New: regex based tracker for plugins and themes meta and options
  • New: monitor based tracked for plugins and themes meta and options
  • New: quick access menu added to the WordPress Admin Bar
  • Edit: reorganized plugin dashboard with new widgets structure and layout
  • Edit: improvements to the styling for the statistics panel
  • Edit: purge tools panel have options for the storage entries removal
  • Edit: purge tools panel includes additional information about the process
  • Edit: various improvements to the statistics panel data display
  • Edit: various changes and improvements to the plugin settings
  • Edit: improvements to sweeper’s loading process
  • Edit: Dev4Press Library 4.8
  • Fix: button for hiding the backup notice not working

2.6 (2024.03.14)

  • Edit: updated system requirements for all the sweepers
  • Edit: updated some of the admin menu items names and order
  • Edit: Dev4Press Library 4.7.1

2.5 (2024.01.10)

  • New: tested and compatible with PHP 8.3
  • Edit: various small improvements to the plugin interface
  • Edit: many small changes and cleanup to the PHP code
  • Edit: Dev4Press Library 4.6
  • Fix: several minor layout and styling issues on some panels

2.4.2 (2023.10.06)

  • Edit: Dev4Press Library 4.3.5
  • Fix: includes link to the Database panel which is only available in Pro edition

2.4.1 (2023.09.26)

  • Edit: Dev4Press Library 4.3.3
  • Fix: fatal error with CRON Jobs sweeper after the process is done

2.4 (2023.09.25)

  • New: use website database size to change estimate method
  • New: sweeper: remove unhooked CRON jobs only
  • New: sweeper: buddypress activity meta entries
  • New: sweeper: buddypress groups meta entries
  • New: sweeper: buddypress messages meta entries
  • New: sweeper: buddypress notifications meta entries
  • New: option to control method for the sweeper estimation
  • New: option to have estimates include the index size
  • Edit: many updates and tweaks to the sweeper panels
  • Edit: core updates related to the new shared library
  • Edit: changes to the way action scheduler queries are run
  • Edit: Dev4Press Library 4.3.2
  • Fix: potential problem with action scheduler queries

2.3.1 (2023.09.01)

  • Fix: issue with the French translation for some strings
  • Fix: few minor issues related to the PHP 8.x

2.3 (2023.08.11)

  • New: settings panel for performance related options
  • New: estimate options to run estimates with size or without size estimation
  • New: cache estimates to avoid running estimates query too often
  • New: database dashboard box showing overall statistics for the database
  • New: tools panel for purge of the cache estimation results
  • Edit: many improvements to the code style and formatting

2.2 (2023.05.15)

  • New: sweeper: actionscheduler log entries
  • New: sweeper: actionscheduler log orphaned entries
  • New: sweeper: actionscheduler failed actions
  • New: sweeper: actionscheduler completed actions
  • New: sweeper: actionscheduler canceled actions
  • New: dashboard shows count of sweepers that are currently disabled
  • Edit: improved loading process for the sweepers
  • Edit: Dev4Press Library 4.1.1
  • Fix: few wrong icons used for the plugin interface

2.1.1 (2023.04.01)

  • Edit: few minor updates to used class references
  • Edit: Dev4Press Library 4.0.1
  • Fix: database optimization sweeper triggers server error
  • Fix: missing class reference for sweeppress_db function

2.1 (2023.03.28)

  • New: sweeper: draft posts revisions
  • New: sweeper: postmeta _wp_old_* data records
  • New: constant and filter to disable DB optimize/repair sweepers
  • New: enhanced preparation of quick and auto sweepers on dashboard
  • Edit: various tweaks to the sweeping estimations
  • Edit: expanded information for the Auto Sweep block
  • Edit: expanded information for the Quick Sweep block
  • Edit: link knowledge base for some settings groups
  • Edit: link knowledge base for some plugin panels
  • Edit: changes to some plugin settings default values
  • Edit: changes to the availability for some sweepers
  • Edit: Dev4Press Library 4.0
  • Fix: wrong calculations for the post revisions sweeper

2.0 (2023.03.10)

  • New: sweeper: multisite wp_signups table
  • Edit: few more improvements in calculating estimates size
  • Edit: expanded content displayed in WordPress Help panel
  • Edit: CLI subcommands: improved information returned
  • Edit: CLI command: now with main description included
  • Fix: REST API results: shows HTML tags for size estimate
  • Fix: REST API endpoints: additional information for arguments
  • Fix: CLI command list: shows HTML tags for size estimate column
  • Fix: CLI subcommands: few problems with the help information
  • Fix: CLI results: few issues with labels and formatting

1.8 (2023.03.03)

  • New: sweepers on sweep panels have new toggle to list affected tables
  • Edit: improved data size estimate calculation for NULL values
  • Edit: several optimizations to the main JavaScript file
  • Edit: Dev4Press Library 3.9.3
  • Fix: statistics logging puts Sweep panel results under Quick
  • Fix: statistics panel filter is throwing fatal error on load
  • Fix: comments by status sweeper not taking comment type into account
  • Fix: changelog link from the what’s new about panel not working

1.7 (2023.02.03)

  • New: tested with WordPress 6.1
  • New: tested with PHP 8.1 and 8.2
  • Edit: all grid panels improved with new library base class
  • Edit: various small styling updates and improvements
  • Edit: Dev4Press Library 3.9.1

1.6 (2022.10.31)

  • New: sweeper: repair broken database tables
  • New: alternative methods for the database tables optimization
  • New: run analyze method after the database tables optimization
  • New: each sweeper includes plugin version when it was added
  • Edit: updated information for some sweepers
  • Edit: database status code with better views exclusion process

1.5 (2022.06.07)

  • Edit: improved statistics panel collected data display
  • Edit: several minor updates to the core objects
  • Edit: information about the new Monitor feature in Pro edition
  • Fix: potential division by zero issue with the size calculations
  • Fix: problem with the uppercase database table names

1.4.1 (2022.05.28)

  • Fix: sweepers missing with WordPress 6.0
  • Fix: sweepers missing with ClassicPress 1.4

1.4 (2022.05.18)

  • Edit: improved layout for the plugin dashboard
  • Edit: d4pLib 3.8
  • Fix: responsive layout issue with auto sweep box

1.3 (2022.04.02)

  • New: panel with list of all sweepers and where they can be used
  • Edit: updated information in the Help areas for various panels
  • Edit: updated information about screenshots
  • Edit: updated several plugin screenshots
  • Edit: several updates to the readme file

1.2 (2022.03.15)

  • New: show list of affected tables more prominently inside help area
  • New: show percentage of the data to be removed compared to affected tables size
  • Edit: many improvements to the sweepers core classes
  • Edit: improved query for calculation of tables to optimize
  • Edit: calculation of tables to optimize takes index into account
  • Edit: expanded help information for some sweepers
  • Edit: expanded information for some plugin settings
  • Edit: several minor styling and layout tweaks and improvements
  • Edit: d4pLib 3.7.4
  • Removed: few unused and obsolete functions and methods
  • Fix: minor issue with database fragmentation calculation

1.1 (2022.03.08)

  • New: sweeper: akismet meta records removal
  • Fix: minor issue with the translation format

1.0 (2022.03.03)

  • First official release