Preview:
delete_post_meta( int $post_id, string $meta_key, mixed $meta_value = '' )
Deletes a post meta field for the given post ID.

Description
You can match based on the key, or key and value. Removing based on key and value, will keep from removing duplicate metadata with the same key. It also allows removing all metadata matching the key, if needed.

Parameters
$post_id
(int) (Required) Post ID.

$meta_key
(string) (Required) Metadata name.

$meta_value
(mixed) (Optional) Metadata value. If provided, rows will only be removed that match the value. Must be serializable if non-scalar.
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter