WPDev.one
Core Function
View Source on Trac ↗

delete_post_meta()

delete_post_meta( mixed $post_id, mixed $meta_key, mixed $meta_value = '' )

Deletes a post meta field for the given post ID.

Parameters 3 required

Name / Type Description
$post_id
int

Post ID.

Required
$meta_key
string

Metadata name.

Required
mixed

$meta_value Optional. Metadata value. If provided, rows will only be removed that match the value. Must be serializable if non-scalar. Default empty.

Required

Return Value

(bool)
True on success, false on failure.

Function Information

Since Version
1.5.0
Source File
wp-includes/post.php
Advertisement