WP-Sweep 2.0.1 has 6 actions and 14 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when WP-Sweep fires an action
add_action( 'wp_sweep_admin_comment_sweep', function() {
// Your code runs here.
}, 10, 1 );
// Change a value WP-Sweep is about to use
add_filter( 'wp_sweep_capability', function( $value, $context ) {
// Change $value here.
return $value;
}, 10, 2 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
wp_sweep_admin_comment_sweep
action/** * Fires below the sweep table, where the comment sweeps used to end. */ do_action( 'wp_sweep_admin_comment_sweep' ); -
/** * Fires below the sweep table, where the database sweeps used to end. */ do_action( 'wp_sweep_admin_database_sweep' ); -
wp_sweep_admin_option_sweep
action/** * Fires below the sweep table, where the option sweeps used to end. */ do_action( 'wp_sweep_admin_option_sweep' ); -
wp_sweep_admin_post_sweep
action/** * Fires below the sweep table, where the post sweeps used to end. */ do_action( 'wp_sweep_admin_post_sweep' ); -
wp_sweep_admin_term_sweep
action/** * Fires below the sweep table, where the term sweeps used to end. */ do_action( 'wp_sweep_admin_term_sweep' ); -
wp_sweep_admin_user_sweep
action/** * Fires below the sweep table, where the user sweeps used to end. */ do_action( 'wp_sweep_admin_user_sweep' ); -
wp_sweep_capability
filter/** * Filters the capability required to reach a WP-Sweep screen. */ apply_filters( 'wp_sweep_capability', self::CAPABILITY, $context ); -
/** * Filters the comment meta keys WP-Sweep must never delete. */ apply_filters( 'wp_sweep_commentmeta_whitelist', array() ); -
wp_sweep_count
filter/** * Filters the number of items a sweep would remove. */ apply_filters( 'wp_sweep_count', $count, $name ); -
wp_sweep_defer_counts
filter/** * Filters whether the Sweep screen defers its counts to the script. */ apply_filters( 'wp_sweep_defer_counts', true ); -
wp_sweep_details
filter/** * Filters the sample list of items shown for a sweep. */ apply_filters( 'wp_sweep_details', $details, $name ); -
wp_sweep_excluded_taxonomies
filter/** * Filters the taxonomies excluded from the orphaned term relationships sweep. */ apply_filters( 'wp_sweep_excluded_taxonomies', $excluded_taxonomies ); -
wp_sweep_excluded_termids
filter/** * Filters the term IDs excluded from the unused terms sweep. */ apply_filters( 'wp_sweep_excluded_termids', $excluded_termids ); -
wp_sweep_limit_details
filter/** * Filters how many items a details list may show. */ apply_filters( 'wp_sweep_limit_details', self::DEFAULT_LIMIT_DETAILS ); -
wp_sweep_optimize_tables
filter/** * Filters the tables the optimize sweep operates on. */ apply_filters( 'wp_sweep_optimize_tables', $tables, $wpdb->prefix ); -
wp_sweep_postmeta_whitelist
filter/** * Filters the post meta keys WP-Sweep must never delete. */ apply_filters( 'wp_sweep_postmeta_whitelist', array() ); -
wp_sweep_sweep
filter/** * Filters the message returned after a sweep has run. */ apply_filters( 'wp_sweep_sweep', $message, $name ); -
wp_sweep_termmeta_whitelist
filter/** * Filters the term meta keys WP-Sweep must never delete. */ apply_filters( 'wp_sweep_termmeta_whitelist', array() ); -
wp_sweep_total_count
filter/** * Filters the total number of rows a sweep's percentage is measured against. */ apply_filters( 'wp_sweep_total_count', $count, $name ); -
wp_sweep_usermeta_whitelist
filter/** * Filters the user meta keys WP-Sweep must never delete. */ apply_filters( 'wp_sweep_usermeta_whitelist', array() );
Generated from WP-Sweep's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Can't find the right hook?
We can build the customisation for you. Describe what you need: