WordPress at a glance
filter is not described

delete_(meta_type)_metadata_by_mid filter-hook . WP 5.0.0

Filters whether to delete metadata of a specific type by meta ID.

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


add_filter( 'delete_(meta_type)_metadata_by_mid', 'filter_function_name_8710', 10, 2 );
function filter_function_name_8710( $delete, $meta_id ){
	// filter...

	return $delete;
Whether to allow metadata deletion of the given type.
Meta ID.


Since 5.0.0 Introduced.

Where the hook is called

wp-includes/meta.php 818
$check = apply_filters( "delete_{$meta_type}_metadata_by_mid", null, $meta_id );

Where in WP core the hook is used

wp-includes/default-filters.php 116
add_filter( 'delete_term_metadata_by_mid', 'wp_check_term_meta_support_prefilter' );
wp-includes/ms-default-filters.php 66
add_filter( 'delete_blog_metadata_by_mid', 'wp_check_site_meta_support_prefilter' );