WordPress at Your Fingertips
filter is not described

delete_(meta_type)_metadata filter-hook . WP 3.1.0

Short-circuits deleting metadata of a specific type.

The dynamic portion of the hook, $meta_type, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table). Returning a non-null value will effectively short-circuit the function.


add_filter( 'delete_(meta_type)_metadata', 'filter_function_name_4747', 10, 5 );
function filter_function_name_4747( $delete, $object_id, $meta_key, $meta_value, $delete_all ){
	// filter...

	return $delete;
Whether to allow metadata deletion of the given type.
ID of the object metadata is for.
Metadata key.
Metadata value. Must be serializable if non-scalar.
Whether to delete the matching metadata entries for all objects, ignoring the specified $object_id.
Default: false


Since 3.1.0 Introduced.

Where the hook is called

wp-includes/meta.php 376
$check = apply_filters( "delete_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $delete_all );

Where in WP core the hook is used WordPress

wp-includes/default-filters.php 113
add_filter( 'delete_term_metadata', 'wp_check_term_meta_support_prefilter' );
wp-includes/ms-default-filters.php 64
add_filter( 'delete_blog_metadata', 'wp_check_site_meta_support_prefilter' );