delete_post_meta_by_key( string $post_meta_key )

Delete everything from post meta matching meta key.


Parameters

$post_meta_key

(Required) Key to search for when deleting.


Return

(bool) Whether the post meta key was deleted from the database.


Source

File: wp-includes/post.php

function delete_post_meta_by_key( $post_meta_key ) {
	$deleted = delete_metadata( 'post', null, $post_meta_key, '', true );
	if ( $deleted ) {
		wp_cache_set( 'last_changed', microtime(), 'posts' );
	}
	return $deleted;
}


Changelog

Changelog
Version Description
WP-2.3.0 Introduced.