WP-Sweep icon
Admin & Maintenance

WP-Sweep hooks reference

  • By Lester Chan
  • v2.0.1
  • Updated

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.

functions.phpyour child theme
// 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

  • includes/class-wp-sweep-admin.php line 453
    /**
     * Fires below the sweep table, where the comment sweeps used to end.
     */
    do_action( 'wp_sweep_admin_comment_sweep' );
  • includes/class-wp-sweep-admin.php line 481
    /**
     * Fires below the sweep table, where the database sweeps used to end.
     */
    do_action( 'wp_sweep_admin_database_sweep' );
  • includes/class-wp-sweep-admin.php line 474
    /**
     * Fires below the sweep table, where the option sweeps used to end.
     */
    do_action( 'wp_sweep_admin_option_sweep' );
  • includes/class-wp-sweep-admin.php line 446
    /**
     * Fires below the sweep table, where the post sweeps used to end.
     */
    do_action( 'wp_sweep_admin_post_sweep' );
  • includes/class-wp-sweep-admin.php line 467
    /**
     * Fires below the sweep table, where the term sweeps used to end.
     */
    do_action( 'wp_sweep_admin_term_sweep' );
  • includes/class-wp-sweep-admin.php line 460
    /**
     * Fires below the sweep table, where the user sweeps used to end.
     */
    do_action( 'wp_sweep_admin_user_sweep' );
  • includes/class-wp-sweep.php line 163
    /**
     * Filters the capability required to reach a WP-Sweep screen.
     */
    apply_filters( 'wp_sweep_capability', self::CAPABILITY, $context );
  • includes/class-wp-sweep.php line 1445
    /**
     * Filters the comment meta keys WP-Sweep must never delete.
     */
    apply_filters( 'wp_sweep_commentmeta_whitelist', array() );
  • includes/class-wp-sweep.php line 582
    /**
     * Filters the number of items a sweep would remove.
     */
    apply_filters( 'wp_sweep_count', $count, $name );
  • includes/class-wp-sweep-list-table.php line 392
    /**
     * Filters whether the Sweep screen defers its counts to the script.
     */
    apply_filters( 'wp_sweep_defer_counts', true );
  • includes/class-wp-sweep.php line 665
    /**
     * Filters the sample list of items shown for a sweep.
     */
    apply_filters( 'wp_sweep_details', $details, $name );
  • includes/class-wp-sweep.php line 1351
    /**
     * Filters the taxonomies excluded from the orphaned term relationships sweep.
     */
    apply_filters( 'wp_sweep_excluded_taxonomies', $excluded_taxonomies );
  • includes/class-wp-sweep.php line 1372
    /**
     * Filters the term IDs excluded from the unused terms sweep.
     */
    apply_filters( 'wp_sweep_excluded_termids', $excluded_termids );
  • includes/class-wp-sweep.php line 444
    /**
     * Filters how many items a details list may show.
     */
    apply_filters( 'wp_sweep_limit_details', self::DEFAULT_LIMIT_DETAILS );
  • includes/class-wp-sweep.php line 960
    /**
     * Filters the tables the optimize sweep operates on.
     */
    apply_filters( 'wp_sweep_optimize_tables', $tables, $wpdb->prefix );
  • includes/class-wp-sweep.php line 1434
    /**
     * Filters the post meta keys WP-Sweep must never delete.
     */
    apply_filters( 'wp_sweep_postmeta_whitelist', array() );
  • includes/class-wp-sweep.php line 905
    /**
     * Filters the message returned after a sweep has run.
     */
    apply_filters( 'wp_sweep_sweep', $message, $name );
  • includes/class-wp-sweep.php line 1467
    /**
     * Filters the term meta keys WP-Sweep must never delete.
     */
    apply_filters( 'wp_sweep_termmeta_whitelist', array() );
  • includes/class-wp-sweep.php line 505
    /**
     * Filters the total number of rows a sweep's percentage is measured against.
     */
    apply_filters( 'wp_sweep_total_count', $count, $name );
  • includes/class-wp-sweep.php line 1456
    /**
     * 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: