WordPress at a glance
filter is not described

sanitize_(object_type)_meta_(meta_key) filter-hook . WP 3.3.0

Filters the sanitization of a specific meta key of a specific meta type.

The dynamic portions of the hook name, $meta_type, and $meta_key, refer to the metadata object type (comment, post, term, or user) and the meta key value, respectively.


add_filter( 'sanitize_(object_type)_meta_(meta_key)', 'filter_function_name_5618', 10, 3 );
function filter_function_name_5618( $meta_value, $meta_key, $object_type ){
	// filter...

	return $meta_value;
Meta value to sanitize.
Meta key.
Object type.


Since 3.3.0 Introduced.

Where the hook is called

wp-includes/meta.php 1100
return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}", $meta_value, $meta_key, $object_type );

Where the hook is used (in WP core)

wp-includes/meta.php 1218
add_filter( "sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $args['sanitize_callback'], 10, 4 );
wp-includes/meta.php 1220
add_filter( "sanitize_{$object_type}_meta_{$meta_key}", $args['sanitize_callback'], 10, 3 );
wp-includes/meta.php 1285
remove_filter( "sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $args['sanitize_callback'] );
wp-includes/meta.php 1287
remove_filter( "sanitize_{$object_type}_meta_{$meta_key}", $args['sanitize_callback'] );