WordPress at Your Fingertips

delete_post_thumbnail() WP 1.0

Remove a post thumbnail.

No Hooks.


true|false. True on success, false on failure.


delete_post_thumbnail( $post );
$post(int|WP_Post) (required)
Post ID or post object from which the thumbnail should be removed.


Since 3.3.0 Introduced.

Code of delete_post_thumbnail() WP 5.8

function delete_post_thumbnail( $post ) {
	$post = get_post( $post );
	if ( $post ) {
		return delete_post_meta( $post->ID, '_thumbnail_id' );
	return false;

From tag: Thumbnail (images)

More from category: Thumbnails

No comments
    Log In