WordPress filter hook
wp_session_delete_batch_size
Fired by 10 WordPress plugins, running on 55K+ sites between them.
“Determine the size of each batch for deletion.”
How to use wp_session_delete_batch_size
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'wp_session_delete_batch_size', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Argument names come from WP Travel Engine's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
10 plugins that fire wp_session_delete_batch_size
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WP Travel Engine20,000+ installs
apply_filters( 'wp_session_delete_batch_size', 1000 )includes/lib/wp-session/wp-session.php:150 -
Charitable10,000+ installs
apply_filters( 'wp_session_delete_batch_size', 1000 )includes/libraries/wp-session/wp-cli.php:79 -
NP Quote Request for WooCommerce8,000+ installs
apply_filters( 'wp_session_delete_batch_size', 1000 )wp-session-manager/includes/wp-cli.php:85 -
eCommerce Product Catalog7,000+ installs
apply_filters( 'wp_session_delete_batch_size', 1000 )ext-comp/wp_session/class-wp-session-command.php:82 -
WP Delicious4,000+ installs
apply_filters( 'wp_session_delete_batch_size', 1000 )src/lib/wp-session/wp-session.php:139 -
WP Travel3,000+ installs
apply_filters( 'wp_session_delete_batch_size', 1000 )inc/lib/wp-session/wp-session.php:142 -
Restaurant Menu and Food Ordering2,000+ installs
apply_filters( 'wp_session_delete_batch_size', 1000 )classes/libs/wp_session/wp-session.php:142 -
Product Catalog Simple1,000+ installs
apply_filters( 'wp_session_delete_batch_size', 1000 )core/ext-comp/wp_session/class-wp-session-command.php:82 -
Widget Master10+ installs
apply_filters( 'wp_session_delete_batch_size', 1000 )includes/includes/wp-cli.php:79 -
Post and Page Protect with Azure ADFewer than 10 installs
apply_filters( 'wp_session_delete_batch_size', 1000 )vendors/wp-session-manager/includes/wp-cli.php:79
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.