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:

functions.php
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.

  1. WP Travel Engine icon WP Travel Engine20,000+ installs apply_filters( 'wp_session_delete_batch_size', 1000 ) includes/lib/wp-session/wp-session.php:150
  2. Charitable icon Charitable10,000+ installs apply_filters( 'wp_session_delete_batch_size', 1000 ) includes/libraries/wp-session/wp-cli.php:79
  3. NP Quote Request for WooCommerce icon NP Quote Request for WooCommerce8,000+ installs apply_filters( 'wp_session_delete_batch_size', 1000 ) wp-session-manager/includes/wp-cli.php:85
  4. eCommerce Product Catalog icon eCommerce Product Catalog7,000+ installs apply_filters( 'wp_session_delete_batch_size', 1000 ) ext-comp/wp_session/class-wp-session-command.php:82
  5. WP Delicious icon WP Delicious4,000+ installs apply_filters( 'wp_session_delete_batch_size', 1000 ) src/lib/wp-session/wp-session.php:139
  6. WP Travel icon WP Travel3,000+ installs apply_filters( 'wp_session_delete_batch_size', 1000 ) inc/lib/wp-session/wp-session.php:142
  7. Restaurant Menu and Food Ordering icon Restaurant Menu and Food Ordering2,000+ installs apply_filters( 'wp_session_delete_batch_size', 1000 ) classes/libs/wp_session/wp-session.php:142
  8. Product Catalog Simple icon Product Catalog Simple1,000+ installs apply_filters( 'wp_session_delete_batch_size', 1000 ) core/ext-comp/wp_session/class-wp-session-command.php:82
  9. Widget Master icon Widget Master10+ installs apply_filters( 'wp_session_delete_batch_size', 1000 ) includes/includes/wp-cli.php:79
  10. Post and Page Protect with Azure AD icon 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.