delete_post_meta_by_key( string $post_meta_key )

Deletes everything from post meta matching the given meta key.


Description Description


Parameters Parameters

$post_meta_key

(string) (Required) Key to search for when deleting.


Top ↑

Return Return

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


Top ↑

Source Source

File: wp-includes/post.php

function delete_post_meta_by_key( $post_meta_key ) {
	return delete_metadata( 'post', null, $post_meta_key, '', true );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.